cups.patch 617 B

1234567891011121314151617181920212223242526272829
  1. --- scheduler/main.c.orig 2003-05-01 19:58:28.000000000 +0200
  2. +++ scheduler/main.c 2003-05-03 18:54:34.000000000 +0200
  3. @@ -222,6 +222,25 @@
  4. chdir("/");
  5. + /*
  6. + * Write PID file
  7. + */
  8. +#ifdef PID_FILE
  9. + {
  10. + mode_t old_umask;
  11. + pid_t pid;
  12. + FILE *fp;
  13. +
  14. + old_umask = umask((mode_t) 0022);
  15. + pid = getpid();
  16. + if ((fp = fopen(PID_FILE, "w")) == NULL)
  17. + syslog(LOG_ERR, "cannot write PID file '%s'", PID_FILE);
  18. + fprintf(fp, "%ld\n", (long)pid);
  19. + fclose(fp);
  20. + umask(old_umask);
  21. + }
  22. +#endif
  23. +
  24. #ifndef DEBUG
  25. /*
  26. * Disable core dumps...