Print this page
8485 Remove set but unused variables in usr/src/cmd


   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*

  23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 
  27 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  28 /*        All Rights Reserved   */
  29 
  30 #pragma ident   "%Z%%M% %I%     %E% SMI"
  31 #include <time.h>
  32 #include "uucp.h"
  33 
  34 #ifdef  V7
  35 #define O_RDONLY        0
  36 #endif
  37 #define KILLMSG "the system administrator has killed job"
  38 #define USAGE1  "[-q] | [-m] | [-k JOB [-n]] | [-r JOB [-n]] | [-p]"
  39 #define USAGE2  "[-a] [-s SYSTEM [-j]] [-u USER] [-S STATE]"
  40 #define USAGE3  "-t SYSTEM [-d number] [-c]"
  41 #define LOCK "LCK.."
  42 #define STST_MAX        132
  43 #define MAXDATE         12
  44 #define MINTIME         60
  45 #define MINUTES         60
  46 #define CHAR            "a"
  47 #define MAXSTATE        4
  48 /* #include "logs.h" */
  49 struct m {
  50         char    mach[15];               /* machine name */


1525         time_t                  now;    /* Current time. */
1526 
1527         now = time((time_t *) 0);
1528         td = gmtime(&now);
1529         (void) sprintf(date, "%02d%02d%02d%02d%02d%02d",
1530                                 (td->tm_year % 100),
1531                                 td->tm_mon + 1,
1532                                 td->tm_mday,
1533                                 td->tm_hour,
1534                                 td->tm_min,
1535                                 td->tm_sec
1536                       );
1537         return date;
1538 }
1539 
1540 static void
1541 friendlytime(uplimit, lolimit)
1542 char *uplimit, *lolimit;
1543 {
1544 
1545         char c;
1546 
1547         c = *(uplimit+6);
1548         friendlyptr->uhour[0] = *(uplimit+6);
1549         friendlyptr->uhour[1] = *(uplimit+7);
1550         friendlyptr->lhour[0] = *(lolimit+6);
1551         friendlyptr->lhour[1] = *(lolimit+7);
1552         friendlyptr->umin[0]  = *(uplimit+8);
1553         friendlyptr->umin[1]  = *(uplimit+9);
1554         friendlyptr->lmin[0]  = *(lolimit+8);
1555         friendlyptr->lmin[1]  = *(lolimit+9);
1556 
1557         friendlyptr->uhour[2] = '\0';
1558         friendlyptr->lhour[2] = '\0';
1559         friendlyptr->umin[2] = '\0';
1560         friendlyptr->lmin[2] = '\0';
1561         return;
1562 }
1563 
1564 void
1565 procState(inputargs)
1566 char * inputargs;
1567 {




   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*
  23  * Copyright 2017 Gary Mills
  24  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  25  * Use is subject to license terms.
  26  */
  27 
  28 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  29 /*        All Rights Reserved   */
  30 

  31 #include <time.h>
  32 #include "uucp.h"
  33 
  34 #ifdef  V7
  35 #define O_RDONLY        0
  36 #endif
  37 #define KILLMSG "the system administrator has killed job"
  38 #define USAGE1  "[-q] | [-m] | [-k JOB [-n]] | [-r JOB [-n]] | [-p]"
  39 #define USAGE2  "[-a] [-s SYSTEM [-j]] [-u USER] [-S STATE]"
  40 #define USAGE3  "-t SYSTEM [-d number] [-c]"
  41 #define LOCK "LCK.."
  42 #define STST_MAX        132
  43 #define MAXDATE         12
  44 #define MINTIME         60
  45 #define MINUTES         60
  46 #define CHAR            "a"
  47 #define MAXSTATE        4
  48 /* #include "logs.h" */
  49 struct m {
  50         char    mach[15];               /* machine name */


1525         time_t                  now;    /* Current time. */
1526 
1527         now = time((time_t *) 0);
1528         td = gmtime(&now);
1529         (void) sprintf(date, "%02d%02d%02d%02d%02d%02d",
1530                                 (td->tm_year % 100),
1531                                 td->tm_mon + 1,
1532                                 td->tm_mday,
1533                                 td->tm_hour,
1534                                 td->tm_min,
1535                                 td->tm_sec
1536                       );
1537         return date;
1538 }
1539 
1540 static void
1541 friendlytime(uplimit, lolimit)
1542 char *uplimit, *lolimit;
1543 {
1544 



1545         friendlyptr->uhour[0] = *(uplimit+6);
1546         friendlyptr->uhour[1] = *(uplimit+7);
1547         friendlyptr->lhour[0] = *(lolimit+6);
1548         friendlyptr->lhour[1] = *(lolimit+7);
1549         friendlyptr->umin[0]  = *(uplimit+8);
1550         friendlyptr->umin[1]  = *(uplimit+9);
1551         friendlyptr->lmin[0]  = *(lolimit+8);
1552         friendlyptr->lmin[1]  = *(lolimit+9);
1553 
1554         friendlyptr->uhour[2] = '\0';
1555         friendlyptr->lhour[2] = '\0';
1556         friendlyptr->umin[2] = '\0';
1557         friendlyptr->lmin[2] = '\0';
1558         return;
1559 }
1560 
1561 void
1562 procState(inputargs)
1563 char * inputargs;
1564 {