Add printf attribute to log_err/DPRINTF and fix a few warnings
Modified to not use %z for portability reasons.
This commit is contained in:
committed by
Justin Maggard
parent
45cf9208fb
commit
3a57744735
11
minidlna.c
11
minidlna.c
@ -357,7 +357,8 @@ rescan:
|
||||
else if (ret == 2)
|
||||
DPRINTF(E_WARN, L_GENERAL, "Removed media_dir detected; rescanning...\n");
|
||||
else
|
||||
DPRINTF(E_WARN, L_GENERAL, "Database version mismatch; need to recreate...\n");
|
||||
DPRINTF(E_WARN, L_GENERAL, "Database version mismatch (%d=>%d); need to recreate...\n",
|
||||
ret, DB_VERSION);
|
||||
sqlite3_close(db);
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "rm -rf %s/files.db %s/art_cache", db_path, db_path);
|
||||
@ -424,7 +425,7 @@ writepidfile(const char *fname, int pid, uid_t uid)
|
||||
if (uid > 0)
|
||||
{
|
||||
if (chown(dir, uid, -1) != 0)
|
||||
DPRINTF(E_WARN, L_GENERAL, "Unable to change pidfile ownership: %s\n",
|
||||
DPRINTF(E_WARN, L_GENERAL, "Unable to change pidfile %s ownership: %s\n",
|
||||
dir, strerror(errno));
|
||||
}
|
||||
}
|
||||
@ -440,14 +441,14 @@ writepidfile(const char *fname, int pid, uid_t uid)
|
||||
if (fprintf(pidfile, "%d\n", pid) <= 0)
|
||||
{
|
||||
DPRINTF(E_ERROR, L_GENERAL,
|
||||
"Unable to write to pidfile %s: %s\n", fname);
|
||||
"Unable to write to pidfile %s: %s\n", fname, strerror(errno));
|
||||
ret = -1;
|
||||
}
|
||||
if (uid > 0)
|
||||
{
|
||||
if (fchown(fileno(pidfile), uid, -1) != 0)
|
||||
DPRINTF(E_WARN, L_GENERAL, "Unable to change pidfile ownership: %s\n",
|
||||
pidfile, strerror(errno));
|
||||
DPRINTF(E_WARN, L_GENERAL, "Unable to change pidfile %s ownership: %s\n",
|
||||
fname, strerror(errno));
|
||||
}
|
||||
|
||||
fclose(pidfile);
|
||||
|
Reference in New Issue
Block a user