home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume18 / upsd / patch02 / Patch02
Encoding:
Text File  |  1991-04-13  |  2.7 KB  |  101 lines

  1. *** HISTORY.orig    Thu Apr 11 08:11:34 1991
  2. --- HISTORY    Thu Apr 11 08:15:12 1991
  3. ***************
  4. *** 1,7 ****
  5. ! RELEASE HISTORY
  6.   
  7.   Date      Release  Patch  Description
  8.   -------------------------------------------------------------------------------
  9. ! 03/30/91  1.0      0      Initial release to net
  10.   04/09/91  1.0      1      Fixed stupidity with ups_time alarm setting and
  11. !                           added version stuff
  12. --- 1,9 ----
  13. ! UPSD RELEASE HISTORY    art@pilikia.pegasus.com
  14.   
  15.   Date      Release  Patch  Description
  16.   -------------------------------------------------------------------------------
  17. ! 03/30/91  1.0      0      Initial release to net.
  18.   04/09/91  1.0      1      Fixed stupidity with ups_time alarm setting and
  19. !                           added version stuff.
  20. ! 04/10/91  1.0      2      Added log file locking, only 1 upsd can be running
  21. !                           now.  Also added date to version string.
  22. *** common.h.orig    Thu Apr 11 08:11:34 1991
  23. --- common.h    Thu Apr 11 08:15:12 1991
  24. ***************
  25. *** 12,17 ****
  26. --- 12,18 ----
  27.   #include <string.h>
  28.   #include <fcntl.h>
  29.   #include <time.h>
  30. + #include <unistd.h>
  31.   #include <sys/types.h>
  32.   #include <sys/termio.h>
  33.   #include <sys/signal.h>
  34. *** funcs.c.orig    Thu Apr 11 08:11:35 1991
  35. --- funcs.c    Thu Apr 11 08:15:12 1991
  36. ***************
  37. *** 153,158 ****
  38. --- 153,162 ----
  39.           if ((log_fd = open(ups_log, LOG_FLAGS, LOG_PERMS)) == ERR)
  40.               exit(1);
  41.   
  42. +         /* and advisory lock it */
  43. +         if (lockf(log_fd, F_TLOCK, 0L) == ERR)
  44. +             exit(1);
  45.           writelog(START_MSG);
  46.   
  47.           /* open blocks on UPS switch to battery */
  48. ***************
  49. *** 292,301 ****
  50.   {
  51.       char   *basename();
  52.   
  53. !     /* display version if foreground */
  54.       if (signal(SIGINT, SIG_IGN) != SIG_IGN)
  55. !         fprintf(stderr, "%s v%d.%d patchlevel %d\n", basename(s),
  56. !             RELEASE, REVISION, PATCHLEVEL);
  57.   }
  58.   
  59.   /*
  60. --- 296,306 ----
  61.   {
  62.       char   *basename();
  63.   
  64. !     /* display version in foreground */
  65.       if (signal(SIGINT, SIG_IGN) != SIG_IGN)
  66. !         fprintf(stderr, "%s release %s version %d.%d patchlevel %d\n",
  67. !             basename(s), RELEASE_DATE, RELEASE, REVISION,
  68. !             PATCHLEVEL);
  69.   }
  70.   
  71.   /*
  72. *** ups.orig    Thu Apr 11 08:11:35 1991
  73. --- ups    Thu Apr 11 08:15:12 1991
  74. ***************
  75. *** 10,14 ****
  76.   set `who -r`
  77.   if [ $9 = "S" -a -x /etc/upsd ]
  78.   then
  79. !     /etc/upsd
  80.   fi
  81. --- 10,14 ----
  82.   set `who -r`
  83.   if [ $9 = "S" -a -x /etc/upsd ]
  84.   then
  85. !     /etc/upsd &
  86.   fi
  87. *** version.h.orig    Thu Apr 11 08:11:35 1991
  88. --- version.h    Thu Apr 11 08:15:12 1991
  89. ***************
  90. *** 11,14 ****
  91.   #define RELEASE_DATE    "03/30/91"
  92.   #define RELEASE        1
  93.   #define REVISION    0
  94. ! #define PATCHLEVEL    1
  95. --- 11,14 ----
  96.   #define RELEASE_DATE    "03/30/91"
  97.   #define RELEASE        1
  98.   #define REVISION    0
  99. ! #define PATCHLEVEL    2
  100.