]> granicus.if.org Git - procps-ng/commitdiff
give up, GNU libc will never be compatible with UNIX libc
authoralbert <>
Thu, 10 Oct 2002 20:44:35 +0000 (20:44 +0000)
committeralbert <>
Thu, 10 Oct 2002 20:44:35 +0000 (20:44 +0000)
ps/common.h
ps/global.c
ps/output.c
ps/parser.c

index c0fc2f6fcef42e5494a4ca7f8158489ba4772f2c..cb431d53ec844158bcef66517b427799b4a457a0 100644 (file)
@@ -230,28 +230,6 @@ extern int simple_escape_str(char *dst, const char *src, size_t n);
 
 /********************* UNDECIDED GLOBALS **************/
 
-/*
- * fputs(3) should (as in "good behavior") return the number of
- * characters written as it does on Digital Unix, AIX, Irix, and SunOS.
- * I'll assume glibc 2.1 has this extremely useful feature.
- *
- * Note: code ported from other systems will keep breaking until
- * the library is updated. You should patch the library itself if
- * at all possible. (for example, distributers who build libc from
- * source with automatic patching as part of the build process)
- */
-
-#if defined __GLIBC__ && ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) || __GLIBC__ > 2)
-#warning Hopefully fputs(3) has been modernized...
-#else
-#define EMULATE_FPUTS
-#define fputs something_to_avoid_libc_troubles
-static inline int fputs(const char *s, FILE *fp){
-  return fwrite(s,1,strlen(s),fp);
-  /* return fprintf(fp, "%s", s); */
-}
-#endif
-
 /* output.c */
 extern void show_one_proc(proc_t* p);
 extern void print_format_specifiers(void);
index f91855196f0aa8ec7354eda3a1759eefa13c0aa1..240b46a160786ff0b28408f4f8667d853cd86c05 100644 (file)
@@ -351,9 +351,6 @@ void reset_global(void){
 
 /*********** spew variables ***********/
 void self_info(void){
-#ifndef EMULATE_FPUTS
-  int count;
-#endif
   fprintf(stderr,
     "BSD j    %s\n"
     "BSD l    %s\n"
@@ -387,20 +384,6 @@ void self_info(void){
     __GNU_LIBRARY__, __GLIBC__, __GLIBC_MINOR__
   );
 
-#ifdef EMULATE_FPUTS
-  fprintf(stderr, "libc assumed lame, using fprintf to emulate fputs.\n\n");
-#else
-  fprintf(stderr, "fputs(\"");
-  count = fputs("123456789", stderr);
-  fprintf(stderr, "\", stderr) gives %d, which is %s.\n",
-    count, count==9?"good":"BAD!\nAdjust ps/common.h or libc, then recompile"
-  );
-  if(count!=9){
-    fprintf(stderr, "(procps includes a libc patch called glibc.patch)\n");
-  }
-  fprintf(stderr, "\n");
-#endif
-
   fprintf(stderr,
     "header_gap=%d lines_to_next_header=%d\n"
     "screen_cols=%d screen_rows=%d\n"
index bdd15fa4abc42044372ac48dd5e1f61f53a378a3..b4bbfe77e15d69915abfea92b07d27cad449b267 100644 (file)
@@ -1709,7 +1709,7 @@ void show_one_proc(proc_t* p){
       leftpad = 0;
       break;
     default:
-      fputs("bad alignment code\n", stderr);
+      fprintf(stderr, "bad alignment code\n");
       break;
     }
     /* At this point:
index 0a1cd9ed1f525fb48043b408dec8a28dc63becab..84781df2ef0bf87d9e66feb505271e0d127b1997 100644 (file)
@@ -864,7 +864,7 @@ static const char *parse_gnu_option(void){
   case_help:
     trace("--help\n");
     exclusive("--help");
-    fputs(help_message, stderr);
+    fwrite(help_message,1,strlen(help_message),stderr);
     exit(0);
     return NULL;
   case_info:
@@ -1131,7 +1131,7 @@ total_failure:
   reset_parser();
   if(personality & PER_FORCE_BSD) fprintf(stderr, "ERROR: %s\n", err2);
   else fprintf(stderr, "ERROR: %s\n", err);
-  fputs(help_message, stderr);
+  fwrite(help_message,1,strlen(help_message),stderr);
   exit(1);
   /* return 1; */ /* useless */
 }