]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libcupsfilters: In mupdftoraster() replaced perror() by proper logging
authorTill Kamppeter <till.kamppeter@gmail.com>
Tue, 1 Feb 2022 00:30:49 +0000 (21:30 -0300)
committerTill Kamppeter <till.kamppeter@gmail.com>
Tue, 1 Feb 2022 00:30:49 +0000 (21:30 -0300)
All log messages (error, debug, ...) have to go to the log function
and never directly to stderr (as perror() does).

cupsfilters/mupdftoraster.c

index a6504674cf48797846af2722ef0026c4f08bc6af..32041677d303d94a9ef8153999b8d1758f8bd58d 100644 (file)
@@ -205,7 +205,8 @@ mutool_spawn (const char *filename,
   if ((pid = fork()) == 0) {
     /* Execute mutool command line ... */
     execvpe(filename, mutoolargv, envp);
-    perror(filename);
+    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+                "mupdftoraster: Unable to execute %s.", filename);
     goto out;
   }
 
@@ -213,7 +214,9 @@ mutool_spawn (const char *filename,
   if (waitpid (pid, &wstatus, 0) == -1) {
     if (errno == EINTR)
       goto retry_wait;
-    perror ("mutool");
+    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+                "mupdftoraster: Error while waiting for mutool to finish - %s.",
+                strerror(errno));
     goto out;
   }