no point in carrying those ifdefs along,
just cleanup the code that seems either BSD specific or
can't work on klibc.
Signed-off-by: maximilian attems <max at stro.at>
---
 usr/utils/cat.c |   22 +---------------------
 1 files changed, 1 insertions(+), 21 deletions(-)
diff --git a/usr/utils/cat.c b/usr/utils/cat.c
index 1108d2e..7465148 100644
--- a/usr/utils/cat.c
+++ b/usr/utils/cat.c
@@ -39,13 +39,6 @@
 #define __RCSID(arg)
 #endif
 
-#if HAVE_NBTOOL_CONFIG_H
-#include "nbtool_config.h"
-#endif
-
-#ifndef __KLIBC__
-#include <sys/cdefs.h>
-#endif
 #if !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
 	The Regents of the University of California.  All rights reserved.\n");
@@ -60,14 +53,8 @@ __RCSID("$NetBSD: cat.c,v 1.43 2004/01/04 03:31:28
jschauma Exp $");
 #include <sys/stat.h>
 
 #include <ctype.h>
-#ifndef __KLIBC__
-#include <err.h>
-#endif
 #include <errno.h>
 #include <fcntl.h>
-#ifndef __KLIBC__
-#include <locale.h>
-#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -88,11 +75,6 @@ int main(int argc, char *argv[])
 	int ch;
 	struct flock stdout_lock;
 
-#ifndef __KLIBC__
-	setprogname(argv[0]);
-	(void)setlocale(LC_ALL, "");
-#endif
-
 	while ((ch = getopt(argc, argv, "beflnstuv")) != -1)
 		switch (ch) {
 		case 'b':
@@ -117,9 +99,7 @@ int main(int argc, char *argv[])
 			tflag = vflag = 1;	/* -t implies -v */
 			break;
 		case 'u':
-#ifndef __KLIBC__
-			setbuf(stdout, NULL);
-#endif
+			/* unimplemented */
 			break;
 		case 'v':
 			vflag = 1;
-- 
1.7.2.3
maximilian attems
2010-Nov-20  21:48 UTC
[klibc] [PATCH 2/2] utils: cleanup unused includes
several errno.h for no good reasons. cleanup losesetup which is not using getopt_long, thus doesn't need getopt.h nor stdarg.h Signed-off-by: maximilian attems <max at stro.at> --- usr/utils/dmesg.c | 1 - usr/utils/losetup.c | 3 --- usr/utils/mkfifo.c | 1 - usr/utils/nuke.c | 1 - usr/utils/umount.c | 1 - 5 files changed, 0 insertions(+), 7 deletions(-) diff --git a/usr/utils/dmesg.c b/usr/utils/dmesg.c index 61e047e..1960713 100644 --- a/usr/utils/dmesg.c +++ b/usr/utils/dmesg.c @@ -1,5 +1,4 @@ #include <unistd.h> -#include <errno.h> #include <stdio.h> #include <ctype.h> #include <stdlib.h> diff --git a/usr/utils/losetup.c b/usr/utils/losetup.c index 1a47fa9..025deb6 100644 --- a/usr/utils/losetup.c +++ b/usr/utils/losetup.c @@ -349,9 +349,6 @@ int del_loop (const char *device) } -#include <getopt.h> -#include <stdarg.h> - int verbose = 0; char *progname; diff --git a/usr/utils/mkfifo.c b/usr/utils/mkfifo.c index f2ac35f..5a758b2 100644 --- a/usr/utils/mkfifo.c +++ b/usr/utils/mkfifo.c @@ -1,6 +1,5 @@ #include <sys/stat.h> #include <sys/types.h> -#include <errno.h> #include <fcntl.h> #include <signal.h> #include <stdio.h> diff --git a/usr/utils/nuke.c b/usr/utils/nuke.c index 0a282c8..93a04af 100644 --- a/usr/utils/nuke.c +++ b/usr/utils/nuke.c @@ -32,7 +32,6 @@ * do anything. */ -#include <alloca.h> #include <assert.h> #include <dirent.h> #include <errno.h> diff --git a/usr/utils/umount.c b/usr/utils/umount.c index 4469297..41275f7 100644 --- a/usr/utils/umount.c +++ b/usr/utils/umount.c @@ -2,7 +2,6 @@ * by rmk */ #include <sys/mount.h> -#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -- 1.7.2.3
Possibly Parallel Threads
- [PATCH] Fix for dovecotpw on powerpc and other architectures
- [klibc:update-dash] input: Move all input state into parsefile
- [klibc:update-dash] dash: input: Move all input state into parsefile
- Errors Building 4.8
- Dump Analysis -- when NCR server frozen by rsync