nice.c (19331) | nice.c (48566) |
---|---|
1/* 2 * Copyright (c) 1989, 1993, 1994 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 --- 53 unchanged lines hidden (view full) --- 62 int argc; 63 char *argv[]; 64{ 65 int niceness = DEFNICE; 66 67 if (argc < 2) 68 usage(); 69 | 1/* 2 * Copyright (c) 1989, 1993, 1994 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 --- 53 unchanged lines hidden (view full) --- 62 int argc; 63 char *argv[]; 64{ 65 int niceness = DEFNICE; 66 67 if (argc < 2) 68 usage(); 69 |
70 if (argv[1][0] == '-') | 70 if (argv[1][0] == '-') { |
71 if (argv[1][1] == '-' || isdigit(argv[1][1])) { 72 niceness = atoi(argv[1] + 1); 73 ++argv; 74 } else 75 errx(1, "illegal option -- %s", argv[1]); | 71 if (argv[1][1] == '-' || isdigit(argv[1][1])) { 72 niceness = atoi(argv[1] + 1); 73 ++argv; 74 } else 75 errx(1, "illegal option -- %s", argv[1]); |
76 } |
|
76 77 if (argv[1] == NULL) 78 usage(); 79 80 errno = 0; 81 niceness += getpriority(PRIO_PROCESS, 0); 82 if (errno) 83 err(1, "getpriority"); --- 12 unchanged lines hidden --- | 77 78 if (argv[1] == NULL) 79 usage(); 80 81 errno = 0; 82 niceness += getpriority(PRIO_PROCESS, 0); 83 if (errno) 84 err(1, "getpriority"); --- 12 unchanged lines hidden --- |