OSDN Git Service

buildsys: fix IS_IN_lib*
[uclinux-h8/uClibc.git] / utils / getconf.c
index 5ff98e6..408a574 100644 (file)
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #define _GNU_SOURCE 1
+#include "porting.h"
 #include <unistd.h>
 #include <errno.h>
 #include <string.h>
 
 #define PACKAGE "getconf regression test"
 #define VERSION ""
-#ifndef _
-# define _
-#endif
-#define error(status, errnum,...) \
-       {fprintf(stderr, __VA_ARGS__); exit(status);}
+#define _(x) x
+#define error(status, errnum, fmt, ...) \
+       {fprintf(stderr, fmt "\n", ## __VA_ARGS__); exit(status);}
 
 
 struct conf
@@ -1054,13 +1052,11 @@ static const struct { const char *name; int num; } specs[] =
   };
 static const int nspecs = sizeof (specs) / sizeof (specs[0]);
 
-#ifdef __UCLIBC_HAS___PROGNAME__
-extern const char *__progname;
-#else
-#define __progname "foo"
+#ifndef __UCLIBC_HAS___PROGNAME__
+static const char *__progname = "getconf";
 #endif
 
-static void
+static attribute_noreturn void
 usage (void)
 {
   fprintf (stderr,
@@ -1072,7 +1068,7 @@ usage (void)
 }
 
 
-static void
+static attribute_noreturn void
 print_all (const char *path)
 {
   register const struct conf *c;