createdb = 1;
} else {
if (debug)
- printf("Error: Handling database \"%s\" failed: %s\n", dbfilename, strerror(errno));
+ printf("Error (debug): Handling database \"%s\" failed: %s\n", dbfilename, strerror(errno));
return 0;
}
} else {
if (rc) {
db_errcode = rc;
if (debug)
- printf("Error: Can't open database \"%s\": %s\n", dbfilename, sqlite3_errmsg(db));
+ printf("Error (debug): Can't open database \"%s\": %s\n", dbfilename, sqlite3_errmsg(db));
return 0;
} else {
if (debug)
#endif
if (!db_create()) {
if (debug)
- printf("Error: Creating database \"%s\" structure failed\n", dbfilename);
+ printf("Error (debug): Creating database \"%s\" structure failed\n", dbfilename);
db_close();
return 0;
} else {
printf("Database \"%s\" structure created\n", dbfilename);
if (!db_setinfo("dbversion", SQLDBVERSION, 1)) {
if (debug)
- printf("Error: Writing version info to database \"%s\" failed\n", dbfilename);
+ printf("Error (debug): Writing version info to database \"%s\" failed\n", dbfilename);
db_close();
return 0;
}
} else {
db_errcode = rc;
if (debug)
- printf("Error: Closing database failed (%d): %s\n", rc, sqlite3_errmsg(db));
+ printf("Error (debug): Closing database failed (%d): %s\n", rc, sqlite3_errmsg(db));
return 0;
}
}
return 0;
}
if (debug)
- printf("Error: stat() \"%s\": %s\n", file, strerror(errno));
+ printf("Error (debug): stat() \"%s\": %s\n", file, strerror(errno));
}
return 1;
}
if (!strlen(dir)) {
if (debug)
- printf("Error: mkpath(), no directory given\n");
+ printf("Error (debug): mkpath(), no directory given\n");
return 0;
}
if (!direxists(tmp)) {
if (mkdir(tmp, mode) != 0) {
if (debug)
- printf("Error: mkdir() \"%s\": %s\n", tmp, strerror(errno));
+ printf("Error (debug): mkdir() \"%s\": %s\n", tmp, strerror(errno));
ret = 0;
break;
}
if (ret) {
if (mkdir(tmp, mode) != 0) {
if (debug)
- printf("Error: mkdir() \"%s\": %s\n", tmp, strerror(errno));
+ printf("Error (debug): mkdir() \"%s\": %s\n", tmp, strerror(errno));
ret = 0;
} else if (debug) {
printf("created: %s\n", tmp);
if (statbuf.st_uid != uid || statbuf.st_gid != gid) {
if (fchown(dir_fd, uid, gid) != 0) {
if (debug)
- printf("Error: updatedirowner() chown() \"%s\": %s\n", dir, strerror(errno));
+ printf("Error (debug): updatedirowner() chown() \"%s\": %s\n", dir, strerror(errno));
close(dir_fd);
return;
} else {
if ((d = fdopendir(dir_fd)) == NULL) {
if (debug)
- printf("Error: updatedirowner() diropen() \"%s\": %s\n", dir, strerror(errno));
+ printf("Error (debug): updatedirowner() diropen() \"%s\": %s\n", dir, strerror(errno));
close(dir_fd);
return;
}
if (statbuf.st_uid != uid || statbuf.st_gid != gid) {
if (fchown(file_fd, uid, gid) != 0) {
if (debug)
- printf("Error: chown() \"%s\": %s\n", entryname, strerror(errno));
+ printf("Error (debug): chown() \"%s\": %s\n", entryname, strerror(errno));
} else {
if (debug)
printf("\"%s\" chown completed\n", entryname);
if (stat(dir, &statbuf) != 0) {
if (debug)
- printf("Error: stat() \"%s\": %s\n", dir, strerror(errno));
+ printf("Error (debug): stat() \"%s\": %s\n", dir, strerror(errno));
return 0;
}