libbb: make "COMMON_BUFSIZE = 1024 bytes, the buffer will be malloced" work
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 21 Apr 2016 19:03:51 +0000 (21:03 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 21 Apr 2016 19:03:51 +0000 (21:03 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/common_bufsiz.c
scripts/generate_BUFSIZ.sh

index c16c361c9f994de1122e411c26a7ae5227134423..26faafcbbefb2ae9b2ef4822504b71bad0a7db44 100644 (file)
@@ -55,14 +55,14 @@ char bb_common_bufsiz1[COMMON_BUFSIZE] ALIGNED(sizeof(long long));
 
 # ifndef setup_common_bufsiz
 /*
- * It is not a "((void)0)" macro. It means we have to provide this function.
+ * It is not defined as a dummy macro.
+ * It means we have to provide this function.
  */
 char* bb_common_bufsiz1;
-char* setup_common_bufsiz(void)
+void setup_common_bufsiz(void)
 {
        if (!bb_common_bufsiz1)
                bb_common_bufsiz1 = xzalloc(COMMON_BUFSIZE);
-       return bb_common_bufsiz1;
 }
 # else
 #  ifndef bb_common_bufsiz1
index bb073864178022f16d8a8bff0d151ad3e960243c..d54142597570eb29fac39e095ca7f27f30601cf1 100755 (executable)
@@ -87,7 +87,8 @@ if test $REM -lt 1024; then
                echo "Rerun make to build a binary which doesn't use it!"
                exit 1
        fi
-        exit 0
+       echo "COMMON_BUFSIZE = 1024 bytes, the buffer will be malloced"
+       exit 0
 fi
 
 # _end[] has REM bytes for bb_common_bufsiz1[]
@@ -102,7 +103,7 @@ echo "#define setup_common_bufsiz() ((void)0)"
 } | regenerate "$common_bufsiz_h"
 echo $REM >"$common_bufsiz_h.BUFSIZE"
 
-# Check that code did not grow too much and thus _end[] did not shink:
+# Check that code did not grow too much and thus _end[] did not shrink:
 if test $OLD -gt $REM; then
        echo "Warning! Space in _end[] has decreased from $OLD to $REM bytes!"
        echo "Rerun make!"