Merge commit 'refs/merge-requests/10' of git://gitorious.org/procps/procps into merge-requests/10
This commit is contained in:
commit
293b668d5f
12
configure.ac
12
configure.ac
@ -137,6 +137,18 @@ dnl else
|
|||||||
dnl ALL_LINGUAS="af am ar as be bg bn_IN bn ca cs cy da de el en_GB es et eu_ES fa fi fr gl gu he hi hr hu hy id is it ja ka kn ko ku lo lt lv mk ml mr ms my nb nl nn no nso or pa pl pt_BR pt ro ru si sk sl sq sr@Latn sr sv ta te th tr uk ur vi zh_CN zh_TW zu"
|
dnl ALL_LINGUAS="af am ar as be bg bn_IN bn ca cs cy da de el en_GB es et eu_ES fa fi fr gl gu he hi hr hu hy id is it ja ka kn ko ku lo lt lv mk ml mr ms my nb nl nn no nso or pa pl pt_BR pt ro ru si sk sl sq sr@Latn sr sv ta te th tr uk ur vi zh_CN zh_TW zu"
|
||||||
dnl fi
|
dnl fi
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS(error.h, [], [], AC_INCLUDES_DEFAULT)
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS(stdio_ext.h, [], [], AC_INCLUDES_DEFAULT)
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(whether program_invocation_name is defined)
|
||||||
|
AC_TRY_COMPILE([#include <errno.h>],
|
||||||
|
[program_invocation_name = "test";],
|
||||||
|
AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME, 1,
|
||||||
|
[Define if program_invocation_name is defined])
|
||||||
|
AC_MSG_RESULT(yes),
|
||||||
|
AC_MSG_RESULT(no))
|
||||||
|
|
||||||
AC_MSG_CHECKING(whether program_invocation_short_name is defined)
|
AC_MSG_CHECKING(whether program_invocation_short_name is defined)
|
||||||
AC_TRY_COMPILE([#include <errno.h>],
|
AC_TRY_COMPILE([#include <errno.h>],
|
||||||
[program_invocation_short_name = "test";],
|
[program_invocation_short_name = "test";],
|
||||||
|
2
free.c
2
free.c
@ -223,7 +223,9 @@ int main(int argc, char **argv)
|
|||||||
args.repeat_interval = 1000000;
|
args.repeat_interval = 1000000;
|
||||||
args.repeat_counter = 0;
|
args.repeat_counter = 0;
|
||||||
|
|
||||||
|
#ifdef HAVE_PROGRAM_INVOCATION_NAME
|
||||||
program_invocation_name = program_invocation_short_name;
|
program_invocation_name = program_invocation_short_name;
|
||||||
|
#endif
|
||||||
setlocale (LC_ALL, "");
|
setlocale (LC_ALL, "");
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
|
21
include/c.h
21
include/c.h
@ -16,7 +16,11 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#ifdef HAVE_ERROR_H
|
||||||
#include <error.h>
|
#include <error.h>
|
||||||
|
#else
|
||||||
|
#include <stdarg.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Compiler specific stuff
|
* Compiler specific stuff
|
||||||
@ -103,6 +107,23 @@ static inline char *prog_inv_sh_nm_from_file(char *f, char stripext)
|
|||||||
/*
|
/*
|
||||||
* Error printing.
|
* Error printing.
|
||||||
*/
|
*/
|
||||||
|
#ifndef HAVE_ERROR_H
|
||||||
|
/* Emulate the error() function from glibc */
|
||||||
|
__attribute__((__format__(__printf__, 3, 4)))
|
||||||
|
static void error(int status, int errnum, const char *format, ...)
|
||||||
|
{
|
||||||
|
va_list argp;
|
||||||
|
fprintf(stderr, "%s: ", program_invocation_short_name);
|
||||||
|
va_start(argp, format);
|
||||||
|
vfprintf(stderr, format, argp);
|
||||||
|
va_end(argp);
|
||||||
|
if (errnum != 0)
|
||||||
|
fprintf(stderr, ": error code %d", errnum);
|
||||||
|
fprintf(stderr, "\n");
|
||||||
|
if (status != 0)
|
||||||
|
exit(status);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#define xwarn(...) error(0, errno, __VA_ARGS__)
|
#define xwarn(...) error(0, errno, __VA_ARGS__)
|
||||||
#define xwarnx(...) error(0, 0, __VA_ARGS__)
|
#define xwarnx(...) error(0, 0, __VA_ARGS__)
|
||||||
#define xerr(STATUS, ...) error(STATUS, errno, __VA_ARGS__)
|
#define xerr(STATUS, ...) error(STATUS, errno, __VA_ARGS__)
|
||||||
|
@ -1,11 +1,22 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <error.h>
|
#ifdef HAVE_ERROR_H
|
||||||
#include <stdio_ext.h>
|
# include <error.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_STDIO_EXT_H
|
||||||
|
# include <stdio_ext.h>
|
||||||
|
#else
|
||||||
|
/* FIXME: use a more portable definition of __fpending() (from gnulib?) */
|
||||||
|
# include <stdio.h>
|
||||||
|
# define __fpending(fp) ((fp)->_p - (fp)->_bf._base)
|
||||||
|
#endif
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "nls.h"
|
#include "nls.h"
|
||||||
#include "fileutils.h"
|
#include "fileutils.h"
|
||||||
|
#ifndef HAVE_ERROR_H
|
||||||
|
# include "c.h" /* for error() emulation */
|
||||||
|
#endif
|
||||||
|
|
||||||
int close_stream(FILE * stream)
|
int close_stream(FILE * stream)
|
||||||
{
|
{
|
||||||
|
2
pgrep.c
2
pgrep.c
@ -832,7 +832,9 @@ int main (int argc, char **argv)
|
|||||||
struct el *procs;
|
struct el *procs;
|
||||||
int num;
|
int num;
|
||||||
|
|
||||||
|
#ifdef HAVE_PROGRAM_INVOCATION_NAME
|
||||||
program_invocation_name = program_invocation_short_name;
|
program_invocation_name = program_invocation_short_name;
|
||||||
|
#endif
|
||||||
setlocale (LC_ALL, "");
|
setlocale (LC_ALL, "");
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
|
2
pmap.c
2
pmap.c
@ -1012,7 +1012,9 @@ int main(int argc, char **argv)
|
|||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef HAVE_PROGRAM_INVOCATION_NAME
|
||||||
program_invocation_name = program_invocation_short_name;
|
program_invocation_name = program_invocation_short_name;
|
||||||
|
#endif
|
||||||
nls_initialize();
|
nls_initialize();
|
||||||
atexit(close_stdout);
|
atexit(close_stdout);
|
||||||
|
|
||||||
|
2
pwdx.c
2
pwdx.c
@ -74,7 +74,9 @@ int main(int argc, char *argv[])
|
|||||||
{NULL, 0, 0, 0}
|
{NULL, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef HAVE_PROGRAM_INVOCATION_NAME
|
||||||
program_invocation_name = program_invocation_short_name;
|
program_invocation_name = program_invocation_short_name;
|
||||||
|
#endif
|
||||||
setlocale (LC_ALL, "");
|
setlocale (LC_ALL, "");
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
|
2
skill.c
2
skill.c
@ -629,7 +629,9 @@ static void skillsnice_parse(int argc,
|
|||||||
/* main body */
|
/* main body */
|
||||||
int main(int argc, char ** argv)
|
int main(int argc, char ** argv)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_PROGRAM_INVOCATION_NAME
|
||||||
program_invocation_name = program_invocation_short_name;
|
program_invocation_name = program_invocation_short_name;
|
||||||
|
#endif
|
||||||
struct run_time_conf_t run_time;
|
struct run_time_conf_t run_time;
|
||||||
memset(&run_time, 0, sizeof(struct run_time_conf_t));
|
memset(&run_time, 0, sizeof(struct run_time_conf_t));
|
||||||
my_pid = getpid();
|
my_pid = getpid();
|
||||||
|
@ -300,7 +300,9 @@ int main(int argc, char *argv[])
|
|||||||
{ NULL, 0, NULL, 0 }
|
{ NULL, 0, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef HAVE_PROGRAM_INVOCATION_NAME
|
||||||
program_invocation_name = program_invocation_short_name;
|
program_invocation_name = program_invocation_short_name;
|
||||||
|
#endif
|
||||||
setlocale (LC_ALL, "");
|
setlocale (LC_ALL, "");
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
|
2
sysctl.c
2
sysctl.c
@ -675,7 +675,9 @@ int main(int argc, char *argv[])
|
|||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef HAVE_PROGRAM_INVOCATION_NAME
|
||||||
program_invocation_name = program_invocation_short_name;
|
program_invocation_name = program_invocation_short_name;
|
||||||
|
#endif
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
|
2
tload.c
2
tload.c
@ -114,7 +114,9 @@ int main(int argc, char **argv)
|
|||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef HAVE_PROGRAM_INVOCATION_NAME
|
||||||
program_invocation_name = program_invocation_short_name;
|
program_invocation_name = program_invocation_short_name;
|
||||||
|
#endif
|
||||||
setlocale (LC_ALL, "");
|
setlocale (LC_ALL, "");
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
|
2
uptime.c
2
uptime.c
@ -77,7 +77,9 @@ int main(int argc, char **argv)
|
|||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef HAVE_PROGRAM_INVOCATION_NAME
|
||||||
program_invocation_name = program_invocation_short_name;
|
program_invocation_name = program_invocation_short_name;
|
||||||
|
#endif
|
||||||
setlocale (LC_ALL, "");
|
setlocale (LC_ALL, "");
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
|
2
vmstat.c
2
vmstat.c
@ -724,7 +724,9 @@ int main(int argc, char *argv[])
|
|||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef HAVE_PROGRAM_INVOCATION_NAME
|
||||||
program_invocation_name = program_invocation_short_name;
|
program_invocation_name = program_invocation_short_name;
|
||||||
|
#endif
|
||||||
setlocale (LC_ALL, "");
|
setlocale (LC_ALL, "");
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
|
2
w.c
2
w.c
@ -483,7 +483,9 @@ int main(int argc, char **argv)
|
|||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef HAVE_PROGRAM_INVOCATION_NAME
|
||||||
program_invocation_name = program_invocation_short_name;
|
program_invocation_name = program_invocation_short_name;
|
||||||
|
#endif
|
||||||
setlocale (LC_ALL, "");
|
setlocale (LC_ALL, "");
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
|
3
watch.c
3
watch.c
@ -31,7 +31,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "fileutils.h"
|
#include "fileutils.h"
|
||||||
#include "nls.h"
|
#include "nls.h"
|
||||||
#include "proc/procps.h"
|
|
||||||
#include "strutils.h"
|
#include "strutils.h"
|
||||||
#include "xalloc.h"
|
#include "xalloc.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@ -590,7 +589,9 @@ int main(int argc, char *argv[])
|
|||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef HAVE_PROGRAM_INVOCATION_NAME
|
||||||
program_invocation_name = program_invocation_short_name;
|
program_invocation_name = program_invocation_short_name;
|
||||||
|
#endif
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
|
Loading…
Reference in New Issue
Block a user