]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/main.c
Merge changes from CUPS 1.7svn-r10643
[thirdparty/cups.git] / scheduler / main.c
index afb6e2e6287377b02590c96a31cb7ca8fe2c67a9..07b0c153407b32ebb2a0d0f5d1625b2d030e4c32 100644 (file)
 #if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO)
 #  include <malloc.h>
 #endif /* HAVE_MALLOC_H && HAVE_MALLINFO */
+
 #ifdef HAVE_NOTIFY_H
 #  include <notify.h>
 #endif /* HAVE_NOTIFY_H */
 
+#ifdef HAVE_SYS_PARAM_H
+#  include <sys/param.h>
+#endif /* HAVE_SYS_PARAM_H */
+
 
 /*
  * Local functions...
@@ -129,10 +134,6 @@ main(int  argc,                            /* I - Number of command-line args */
 #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
   struct sigaction     action;         /* Actions for POSIX signals */
 #endif /* HAVE_SIGACTION && !HAVE_SIGSET */
-#ifdef __sgi
-  cups_file_t          *fp;            /* Fake lpsched lock file */
-  struct stat          statbuf;        /* Needed for checking lpsched FIFO */
-#endif /* __sgi */
   int                  run_as_child = 0;
                                        /* Needed for background fork/exec */
 #ifdef __APPLE__
@@ -365,15 +366,15 @@ main(int  argc,                           /* I - Number of command-line args */
       }
     }
 
-#ifdef __OpenBSD__
+#if defined(__OpenBSD__) && OpenBSD < 201211
    /*
     * Call _thread_sys_closefrom() so the child process doesn't reset the
     * parent's file descriptors to be blocking.  This is a workaround for a
-    * limitation of userland libpthread on OpenBSD.
+    * limitation of userland libpthread on older versions of OpenBSD.
     */
 
     _thread_sys_closefrom(0);
-#endif /* __OpenBSD__ */
+#endif /* __OpenBSD__ && OpenBSD < 201211 */
 
    /*
     * Since CoreFoundation and DBUS both create fork-unsafe data on execution of
@@ -565,28 +566,6 @@ main(int  argc,                            /* I - Number of command-line args */
   signal(SIGTERM, sigterm_handler);
 #endif /* HAVE_SIGSET */
 
-#ifdef __sgi
- /*
-  * Try to create a fake lpsched lock file if one is not already there.
-  * Some Adobe applications need it under IRIX in order to enable
-  * printing...
-  */
-
-  if ((fp = cupsFileOpen("/var/spool/lp/SCHEDLOCK", "w")) == NULL)
-  {
-    syslog(LOG_LPR, "Unable to create fake lpsched lock file "
-                    "\"/var/spool/lp/SCHEDLOCK\"\' - %s!",
-           strerror(errno));
-  }
-  else
-  {
-    fchmod(cupsFileNumber(fp), 0644);
-    fchown(cupsFileNumber(fp), User, Group);
-
-    cupsFileClose(fp);
-  }
-#endif /* __sgi */
-
  /*
   * Initialize authentication certificates...
   */
@@ -1131,18 +1110,6 @@ main(int  argc,                          /* I - Number of command-line args */
     krb5_free_context(KerberosContext);
 #endif /* HAVE_GSSAPI */
 
-#ifdef __sgi
- /*
-  * Remove the fake IRIX lpsched lock file, but only if the existing
-  * file is not a FIFO which indicates that the real IRIX lpsched is
-  * running...
-  */
-
-  if (!stat("/var/spool/lp/FIFO", &statbuf))
-    if (!S_ISFIFO(statbuf.st_mode))
-      unlink("/var/spool/lp/SCHEDLOCK");
-#endif /* __sgi */
-
   cupsdStopSelect();
 
   return (!stop_scheduler);