This commit is contained in:
albert 2002-12-09 07:53:09 +00:00
parent 5087f3dbf6
commit b657e7e08a
7 changed files with 20 additions and 9 deletions

View File

@ -57,8 +57,8 @@ static union el *opt_ruid = NULL;
static char *opt_pattern = NULL;
static int
usage (int opt)
static int usage (int opt) NORETURN;
static int usage (int opt)
{
if (i_am_pkill)
fprintf (stderr, "Usage: pkill [-SIGNAL] [-fvx] ");

1
pmap.c
View File

@ -19,6 +19,7 @@
#include <unistd.h>
#include "proc/version.h" // FIXME: we need to link the lib for this :-(
static void usage(void) NORETURN;
static void usage(void){
fprintf(stderr,
"Usage: pmap [-r] [-x] pid...\n"

View File

@ -18,6 +18,9 @@
#endif
#endif
// since gcc-2.5
#define NORETURN __attribute__((__noreturn__))
#if __GNUC__ > 2 || __GNUC_MINOR__ >= 96
// won't alias anything, and aligned enough for anything
#define MALLOC __attribute__ ((__malloc__))

View File

@ -231,6 +231,7 @@ static void iterate(void){
}
/***** kill help */
static void kill_usage(void) NORETURN;
static void kill_usage(void){
fprintf(stderr,
"Usage:\n"
@ -245,6 +246,7 @@ static void kill_usage(void){
}
/***** kill */
static void kill_main(int argc, const char *restrict const *restrict argv) NORETURN;
static void kill_main(int argc, const char *restrict const *restrict argv){
const char *sigptr;
int signo = SIGTERM;
@ -317,6 +319,7 @@ no_more_args:
}
/***** skill/snice help */
static void skillsnice_usage(void) NORETURN;
static void skillsnice_usage(void){
if(program==PROG_SKILL){
fprintf(stderr,

3
top.c
View File

@ -324,6 +324,7 @@ static const char *tg2 (int x, int y)
/*
* The usual program end --
* called only by functions in this section. */
static void bye_bye (int eno, const char *str) NORETURN;
static void bye_bye (int eno, const char *str)
{
if (!Batch)
@ -408,6 +409,7 @@ static void bye_bye (int eno, const char *str)
* Normal end of execution.
* catches:
* SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT and SIGTERM */
static void end_pgm (int dont_care_sig) NORETURN;
static void end_pgm (int dont_care_sig)
{
(void)dont_care_sig;
@ -417,6 +419,7 @@ static void end_pgm (int dont_care_sig)
/*
* Standard error handler to normalize the look of all err o/p */
static void std_err (const char *str) NORETURN;
static void std_err (const char *str)
{
static char buf[SMLBUFSIZ];

View File

@ -36,7 +36,7 @@ static unsigned int moreheaders=TRUE;
/////////////////////////////////////////////////////////////////////////
static void usage(void) NORETURN;
static void usage(void) {
fprintf(stderr,"usage: vmstat [-V] [-n] [delay [count]]\n");
fprintf(stderr," -V prints version.\n");
@ -47,6 +47,7 @@ static void usage(void) {
exit(EXIT_FAILURE);
}
static void crash(const char *filename) NORETURN;
static void crash(const char *filename) {
perror(filename);
exit(EXIT_FAILURE);

12
watch.c
View File

@ -42,15 +42,15 @@ static int first_screen = 1;
#define min(x,y) ((x) > (y) ? (y) : (x))
static void
do_usage(void)
static void do_usage(void) NORETURN;
static void do_usage(void)
{
fprintf(stderr, usage, progname);
exit(1);
}
static void
do_exit(int status)
static void do_exit(int status) NORETURN;
static void do_exit(int status)
{
if (curses_started)
endwin();
@ -58,8 +58,8 @@ do_exit(int status)
}
/* signal handler */
static void
die(int notused)
static void die(int notused) NORETURN;
static void die(int notused)
{
(void) notused;
do_exit(0);