[BACK]Return to at.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / at

Diff for /src/usr.bin/at/at.c between version 1.68 and 1.69

version 1.68, 2015/11/04 20:28:17 version 1.69, 2015/11/06 23:47:42
Line 31 
Line 31 
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */   */
   
 #define MAIN_PROGRAM  
   
 #include <sys/types.h>  #include <sys/types.h>
 #include <sys/stat.h>  #include <sys/stat.h>
   
Line 100 
Line 98 
 static __dead void  static __dead void
 panic(const char *a)  panic(const char *a)
 {  {
         (void)fprintf(stderr, "%s: %s\n", ProgramName, a);          (void)fprintf(stderr, "%s: %s\n", __progname, a);
         if (fcreated)          if (fcreated)
                 unlink(atfile);                  unlink(atfile);
   
Line 113 
Line 111 
 static __dead void  static __dead void
 panic2(const char *a, const char *b)  panic2(const char *a, const char *b)
 {  {
         (void)fprintf(stderr, "%s: %s%s\n", ProgramName, a, b);          (void)fprintf(stderr, "%s: %s%s\n", __progname, a, b);
         if (fcreated)          if (fcreated)
                 unlink(atfile);                  unlink(atfile);
   
Line 498 
Line 496 
         } else          } else
                 uids = NULL;                  uids = NULL;
   
         shortformat = strcmp(ProgramName, "at") == 0;          shortformat = strcmp(__progname, "at") == 0;
   
         if (chdir(AT_DIR) != 0)          if (chdir(AT_DIR) != 0)
                 perr2("Cannot change to ", AT_DIR);                  perr2("Cannot change to ", AT_DIR);
Line 660 
Line 658 
                                 if (user_uid != pw->pw_uid && user_uid != 0) {                                  if (user_uid != pw->pw_uid && user_uid != 0) {
                                         fprintf(stderr, "%s: Only the superuser"                                          fprintf(stderr, "%s: Only the superuser"
                                             " may %s other users' jobs\n",                                              " may %s other users' jobs\n",
                                             ProgramName, what == ATRM                                              __progname, what == ATRM
                                             ? "remove" : "view");                                              ? "remove" : "view");
                                         exit(EXIT_FAILURE);                                          exit(EXIT_FAILURE);
                                 }                                  }
Line 745 
Line 743 
                 if (jobs[i] != NULL) {                  if (jobs[i] != NULL) {
                         if (!force)                          if (!force)
                                 fprintf(stderr, "%s: %s: no such job\n",                                  fprintf(stderr, "%s: %s: no such job\n",
                                     ProgramName, jobs[i]);                                      __progname, jobs[i]);
                         error++;                          error++;
                 }                  }
         }          }
Line 908 
Line 906 
         if (argc < 1)          if (argc < 1)
                 usage();                  usage();
   
         if ((ProgramName = strrchr(argv[0], '/')) != NULL)  
                 ProgramName++;  
         else  
                 ProgramName = argv[0];  
   
         user_uid = getuid();          user_uid = getuid();
         user_gid = getgid();          user_gid = getgid();
         spool_gid = getegid();          spool_gid = getegid();
   
         /* find out what this program is supposed to do */          /* find out what this program is supposed to do */
         if (strcmp(ProgramName, "atq") == 0) {          if (strcmp(__progname, "atq") == 0) {
                 program = ATQ;                  program = ATQ;
                 options = "cnvq:";                  options = "cnvq:";
         } else if (strcmp(ProgramName, "atrm") == 0) {          } else if (strcmp(__progname, "atrm") == 0) {
                 program = ATRM;                  program = ATRM;
                 options = "afi";                  options = "afi";
         } else if (strcmp(ProgramName, "batch") == 0) {          } else if (strcmp(__progname, "batch") == 0) {
                 program = BATCH;                  program = BATCH;
                 options = "f:q:mv";                  options = "f:q:mv";
         }          }

Legend:
Removed from v.1.68  
changed lines
  Added in v.1.69