summaryrefslogtreecommitdiffstats
path: root/sys-utils/renice.c
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:25:39 +0100
committerKarel Zak2006-12-07 00:25:39 +0100
commit7eda085c41faa3445b4b168ce78ab18dab87d98a (patch)
treeeb8da4baebd0af68fa84818d3d51b4a3714667fc /sys-utils/renice.c
parentImported from util-linux-2.9i tarball. (diff)
downloadkernel-qcow2-util-linux-7eda085c41faa3445b4b168ce78ab18dab87d98a.tar.gz
kernel-qcow2-util-linux-7eda085c41faa3445b4b168ce78ab18dab87d98a.tar.xz
kernel-qcow2-util-linux-7eda085c41faa3445b4b168ce78ab18dab87d98a.zip
Imported from util-linux-2.9v tarball.
Diffstat (limited to 'sys-utils/renice.c')
-rw-r--r--sys-utils/renice.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/sys-utils/renice.c b/sys-utils/renice.c
index 8867d0022..6bc83f992 100644
--- a/sys-utils/renice.c
+++ b/sys-utils/renice.c
@@ -31,6 +31,10 @@
* SUCH DAMAGE.
*/
+ /* 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@misiek.eu.org>
+ * - added Native Language Support
+ */
+
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
@@ -38,6 +42,8 @@
#include <stdio.h>
#include <pwd.h>
#include <stdlib.h>
+#include <errno.h>
+#include "nls.h"
int donice(int,int,int);
@@ -52,10 +58,14 @@ main(int argc, char **argv)
int which = PRIO_PROCESS;
int who = 0, prio, errs = 0;
+ setlocale(LC_ALL, "");
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+
argc--, argv++;
if (argc < 2) {
- fprintf(stderr, "usage: renice priority [ [ -p ] pids ] ");
- fprintf(stderr, "[ [ -g ] pgrps ] [ [ -u ] users ]\n");
+ fprintf(stderr, _("usage: renice priority [ [ -p ] pids ] "
+ "[ [ -g ] pgrps ] [ [ -u ] users ]\n"));
exit(1);
}
prio = atoi(*argv);
@@ -81,7 +91,7 @@ main(int argc, char **argv)
register struct passwd *pwd = getpwnam(*argv);
if (pwd == NULL) {
- fprintf(stderr, "renice: %s: unknown user\n",
+ fprintf(stderr, _("renice: %s: unknown user\n"),
*argv);
continue;
}
@@ -89,7 +99,7 @@ main(int argc, char **argv)
} else {
who = atoi(*argv);
if (who < 0) {
- fprintf(stderr, "renice: %s: bad value\n",
+ fprintf(stderr, _("renice: %s: bad value\n"),
*argv);
continue;
}
@@ -104,19 +114,18 @@ donice(which, who, prio)
int which, who, prio;
{
int oldprio;
- extern int errno;
errno = 0, oldprio = getpriority(which, who);
if (oldprio == -1 && errno) {
fprintf(stderr, "renice: %d: ", who);
- perror("getpriority");
+ perror(_("getpriority"));
return (1);
}
if (setpriority(which, who, prio) < 0) {
fprintf(stderr, "renice: %d: ", who);
- perror("setpriority");
+ perror(_("setpriority"));
return (1);
}
- printf("%d: old priority %d, new priority %d\n", who, oldprio, prio);
+ printf(_("%d: old priority %d, new priority %d\n"), who, oldprio, prio);
return (0);
}