if BUILD_KILL
bin_PROGRAMS = kill
dist_man_MANS += kill.1
+kill_SOURCES = skill.c $(top_srcdir)/lib/strutils.c $(top_srcdir)/lib/fileutils.c
endif
if WITH_NCURSES
dist_man_MANS += \
slabtop.1 \
watch.1
-slabtop_SOURCES = slabtop.c $(top_srcdir)/lib/strutils.c
+slabtop_SOURCES = slabtop.c $(top_srcdir)/lib/strutils.c $(top_srcdir)/lib/fileutils.c
slabtop_LDADD = @NCURSES_LIBS@
-watch_SOURCES = watch.c $(top_srcdir)/lib/strutils.c
+watch_SOURCES = watch.c $(top_srcdir)/lib/strutils.c $(top_srcdir)/lib/fileutils.c
watch_LDADD = @WATCH_NCURSES_LIBS@
endif
usrbin_exec_PROGRAMS += \
skill \
snice
-skill_SOURCES = skill.c $(top_srcdir)/lib/strutils.c
-snice_SOURCES = skill.c $(top_srcdir)/lib/strutils.c
+skill_SOURCES = skill.c $(top_srcdir)/lib/strutils.c $(top_srcdir)/lib/fileutils.c
+snice_SOURCES = skill.c $(top_srcdir)/lib/strutils.c $(top_srcdir)/lib/fileutils.c
dist_man_MANS += \
skill.1 \
snice.1
endif
-kill_SOURCES = skill.c $(top_srcdir)/lib/strutils.c
-tload_SOURCES = tload.c $(top_srcdir)/lib/strutils.c
-pkill_SOURCES = pgrep.c
-free_SOURCES = free.c $(top_srcdir)/lib/strutils.c
-vmstat_SOURCES = vmstat.c $(top_srcdir)/lib/strutils.c
+free_SOURCES = free.c $(top_srcdir)/lib/strutils.c $(top_srcdir)/lib/fileutils.c
+pgrep_SOURCES = pgrep.c $(top_srcdir)/lib/fileutils.c
+pkill_SOURCES = pgrep.c $(top_srcdir)/lib/fileutils.c
+pmap_SOURCES = pmap.c $(top_srcdir)/lib/fileutils.c
+pwdx_SOURCES = pwdx.c $(top_srcdir)/lib/fileutils.c
+sysctl_SOURCES = sysctl.c $(top_srcdir)/lib/fileutils.c
+tload_SOURCES = tload.c $(top_srcdir)/lib/strutils.c $(top_srcdir)/lib/fileutils.c
+uptime_SOURCES = uptime.c $(top_srcdir)/lib/fileutils.c
+vmstat_SOURCES = vmstat.c $(top_srcdir)/lib/strutils.c $(top_srcdir)/lib/fileutils.c
+w_SOURCES = w.c $(top_srcdir)/lib/fileutils.c
sysconf_DATA = sysctl.conf
#include "c.h"
#include "nls.h"
#include "strutils.h"
+#include "fileutils.h"
#include <locale.h>
#include <errno.h>
setlocale (LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((c = getopt_long(argc, argv, "bkmghlotc:s:V", longopts, NULL)) != -1)
switch (c) {
#define XALLOC_EXIT_CODE EXIT_FATAL
#include "c.h"
+#include "fileutils.h"
#include "nls.h"
#include "xalloc.h"
#include "proc/readproc.h"
setlocale (LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
parse_opts (argc, argv);
#include <unistd.h>
#include "c.h"
+#include "fileutils.h"
#include "nls.h"
#include "proc/escape.h"
#include "xalloc.h"
setlocale (LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
x_option = d_option = q_option = 0;
parser.c \
select.c \
sortformat.c \
- stacktrace.c
+ stacktrace.c \
+ $(top_srcdir)/lib/fileutils.c
EXTRA_DIST = \
HACKING \
#include "../proc/version.h"
#include "../proc/wchan.h"
+#include "../include/fileutils.h"
#include "common.h"
#ifndef SIGCHLD
/***** no comment */
int main(int argc, char *argv[]){
+ atexit(close_stdout);
myname = strrchr(*argv, '/');
if (myname) ++myname; else myname = *argv;
#include "c.h"
#include "nls.h"
#include "xalloc.h"
+#include "fileutils.h"
static void __attribute__ ((__noreturn__)) usage(FILE * out)
{
setlocale (LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((ch = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1)
switch (ch) {
#include <unistd.h>
#include "c.h"
+#include "fileutils.h"
#include "strutils.h"
#include "nls.h"
#include "xalloc.h"
setlocale (LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
if (argc < 2)
kill_usage(stderr);
#include <unistd.h>
#include "c.h"
+#include "fileutils.h"
#include "nls.h"
#include "strutils.h"
#include "proc/slab.h"
setlocale (LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
sort_func = DEF_SORT_FUNC;
#include <unistd.h>
#include "c.h"
+#include "fileutils.h"
#include "nls.h"
#include "xalloc.h"
#include "proc/procps.h"
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
PrintName = true;
PrintNewline = true;
#include "proc/version.h"
#include "proc/sysinfo.h"
#include "c.h"
+#include "fileutils.h"
#include "nls.h"
#include "strutils.h"
#include "xalloc.h"
setlocale (LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((opt =
getopt_long(argc, argv, "s:d:Vh", longopts, NULL)) != -1)
top.h \
top.c \
top_nls.h \
- top_nls.c
+ top_nls.c \
+ $(top_srcdir)/lib/fileutils.c
dist_man_MANS = \
top.1
#include <unistd.h>
#include <values.h>
+#include "../include/fileutils.h"
#include "../include/nls.h"
#include "../proc/devname.h"
* duh... */
int main (int dont_care_argc, char **argv) {
(void)dont_care_argc;
+ atexit(close_stdout);
before(*argv);
// +-------------+
wins_stage_1(); // top (sic) slice
#include <stdio.h>
#include "c.h"
+#include "fileutils.h"
#include "nls.h"
#include "proc/whattime.h"
#include "proc/version.h"
setlocale (LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((c = getopt_long(argc, argv, "hV", longopts, NULL)) != -1)
switch (c) {
#include <unistd.h>
#include "c.h"
+#include "fileutils.h"
#include "nls.h"
#include "strutils.h"
#include "proc/sysinfo.h"
setlocale (LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((c =
getopt_long(argc, argv, "afmnsdDp:S:hV", longopts,
*/
#include "c.h"
+#include "fileutils.h"
#include "nls.h"
#include "proc/devname.h"
#include "proc/escape.h"
setlocale (LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
#ifndef W_SHOWFROM
from = 0;
#include "c.h"
#include "config.h"
+#include "fileutils.h"
#include "nls.h"
#include "proc/procps.h"
#include "strutils.h"
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((optc =
getopt_long(argc, argv, "+bced::ghn:pvtx", longopts, (int *)0))