Merge branch 'macos10.15-compile-fixes' into 'master'

Compile fixes for macOS 10.15 and later

See merge request sane-project/frontends!8
merge-requests/13/head
Ralph Little 2023-02-12 02:03:23 +00:00
commit a7fec47bec
1 zmienionych plików z 20 dodań i 19 usunięć

Wyświetl plik

@ -97,30 +97,31 @@ sanei_debug_msg
(int level, int max_level, const char *be, const char *fmt, va_list ap)
{
char *msg;
if (max_level >= level)
{
if ( 1 == isfdtype(fileno(stderr), S_IFSOCK) )
{
msg = (char *)malloc (sizeof(char) * (strlen(be) + strlen(fmt) + 4));
if (msg == NULL)
{
syslog (LOG_DEBUG, "[sanei_debug] malloc() failed\n");
vsyslog (LOG_DEBUG, fmt, ap);
}
else
{
sprintf (msg, "[%s] %s", be, fmt);
struct stat sb;
if ( 0 == fstat(fileno(stderr), &sb) && S_IFSOCK == (sb.st_mode & S_IFMT) )
{
msg = (char *)malloc (sizeof(char) * (strlen(be) + strlen(fmt) + 4));
if (msg == NULL)
{
syslog (LOG_DEBUG, "[sanei_debug] malloc() failed\n");
vsyslog (LOG_DEBUG, fmt, ap);
}
else
{
sprintf (msg, "[%s] %s", be, fmt);
vsyslog(LOG_DEBUG, msg, ap);
free (msg);
}
}
free (msg);
}
}
else
{
fprintf (stderr, "[%s] ", be);
{
fprintf (stderr, "[%s] ", be);
vfprintf (stderr, fmt, ap);
}
}
}
}