Group :: Monitoring
RPM: acct
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: acct-alt-program_name.patch
Download
Download
--- acct/ac.c
+++ acct/ac.c
@@ -22,6 +22,10 @@ MA 02139, USA.
#include "config.h"
#include <stdio.h>
+#ifdef HAVE_ERRNO_H
+# include <errno.h>
+#endif
+
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -173,7 +177,7 @@ int main(int argc, char *argv[])
int other_wtmp_file_specified = 0; /* nonzero if the user used the
`-f' or `--other-file' flags */
- program_name = argv[0];
+ program_name = program_invocation_short_name;
/* Init the utmp reader for reading forwards in the files. */
--- acct/accton.c
+++ acct/accton.c
@@ -119,7 +119,7 @@ int main(int argc, char *argv[])
int c, status_acct, number_args;
char *acct_file = NULL;
- program_name = argv[0];
+ program_name = program_invocation_short_name;
/* deal with options */
--- acct/dump-acct.c
+++ acct/dump-acct.c
@@ -25,6 +25,10 @@ MA 02139, USA.
#include <stdio.h>
+#ifdef HAVE_ERRNO_H
+# include <errno.h>
+#endif
+
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -69,7 +73,7 @@ int main(int argc, char *argv[])
static struct acct buf;
#endif
- program_name = argv[0];
+ program_name = program_invocation_short_name;
while (1)
{
--- acct/dump-utmp.c
+++ acct/dump-utmp.c
@@ -25,6 +25,10 @@ MA 02139, USA.
#include <stdio.h>
+#ifdef HAVE_ERRNO_H
+# include <errno.h>
+#endif
+
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -58,7 +62,7 @@ int main(int argc, char *argv[])
long num_lines_to_print = -1; /* -1 means all */
int raw = 0;
- program_name = argv[0];
+ program_name = program_invocation_short_name;
while (1)
{
--- acct/last.c
+++ acct/last.c
@@ -22,6 +22,10 @@ MA 02139, USA.
#include "config.h"
#include <stdio.h>
+#ifdef HAVE_ERRNO_H
+# include <errno.h>
+#endif
+
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -176,7 +180,7 @@ int main(int argc, char *argv[])
int other_wtmp_file_specified = 0; /* nonzero if the user used the
`-f' or `--file' flags */
- program_name = argv[0];
+ program_name = program_invocation_short_name;
/* Tell the utmp reader that we want to do things backwards! */
--- acct/lastcomm.c
+++ acct/lastcomm.c
@@ -20,6 +20,10 @@ MA 02139, USA. */
#include "config.h"
#include <stdio.h>
+#ifdef HAVE_ERRNO_H
+# include <errno.h>
+#endif
+
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -104,7 +108,7 @@ int main(int argc, char *argv[])
hzval = sysconf(_SC_CLK_TCK);
- program_name = argv[0];
+ program_name = program_invocation_short_name;
while (1)
{
--- acct/sa.c
+++ acct/sa.c
@@ -43,6 +43,10 @@ char *alloca ();
#include <stdio.h>
+#ifdef HAVE_ERRNO_H
+# include <errno.h>
+#endif
+
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -283,7 +287,7 @@ int main(int argc, char *argv[])
int c;
hzval = sysconf(_SC_CLK_TCK);
- program_name = argv[0];
+ program_name = program_invocation_short_name;
/* Cache the page size of the machine for the PAGES_TO_KB macro */
system_page_size = (double) getpagesize () / 1024.0;