shutdown.c (227081) | shutdown.c (229403) |
---|---|
1/* 2 * Copyright (c) 1988, 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 25 unchanged lines hidden (view full) --- 34 The Regents of the University of California. All rights reserved.\n"; 35#endif /* not lint */ 36 37#ifndef lint 38static char sccsid[] = "@(#)shutdown.c 8.4 (Berkeley) 4/28/95"; 39#endif /* not lint */ 40#endif 41#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1988, 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 25 unchanged lines hidden (view full) --- 34 The Regents of the University of California. All rights reserved.\n"; 35#endif /* not lint */ 36 37#ifndef lint 38static char sccsid[] = "@(#)shutdown.c 8.4 (Berkeley) 4/28/95"; 39#endif /* not lint */ 40#endif 41#include <sys/cdefs.h> |
42__FBSDID("$FreeBSD: head/sbin/shutdown/shutdown.c 227081 2011-11-04 13:36:02Z ed $"); | 42__FBSDID("$FreeBSD: head/sbin/shutdown/shutdown.c 229403 2012-01-03 18:51:58Z ed $"); |
43 44#include <sys/param.h> 45#include <sys/time.h> 46#include <sys/resource.h> 47#include <sys/syslog.h> 48 49#include <ctype.h> 50#include <err.h> --- 67 unchanged lines hidden (view full) --- 118 119 nosync = NULL; 120 readstdin = 0; 121 122 /* 123 * Test for the special case where the utility is called as 124 * "poweroff", for which it runs 'shutdown -p now'. 125 */ | 43 44#include <sys/param.h> 45#include <sys/time.h> 46#include <sys/resource.h> 47#include <sys/syslog.h> 48 49#include <ctype.h> 50#include <err.h> --- 67 unchanged lines hidden (view full) --- 118 119 nosync = NULL; 120 readstdin = 0; 121 122 /* 123 * Test for the special case where the utility is called as 124 * "poweroff", for which it runs 'shutdown -p now'. 125 */ |
126 if ((p = rindex(argv[0], '/')) == NULL) | 126 if ((p = strrchr(argv[0], '/')) == NULL) |
127 p = argv[0]; 128 else 129 ++p; 130 if (strcmp(p, "poweroff") == 0) { 131 if (getopt(argc, argv, "") != -1) 132 usage((char *)NULL); 133 argc -= optind; 134 argv += optind; --- 406 unchanged lines hidden --- | 127 p = argv[0]; 128 else 129 ++p; 130 if (strcmp(p, "poweroff") == 0) { 131 if (getopt(argc, argv, "") != -1) 132 usage((char *)NULL); 133 argc -= optind; 134 argv += optind; --- 406 unchanged lines hidden --- |