More portability updates. Now compiles cleanly vs glibc, libc5, and uclibc
(except for mkfs_minix and fsck_minix -- and it doesn't yet link vs uclibc due to missing stuff in the library). -Erik
This commit is contained in:
parent
e9b527ae48
commit
999bf72f49
@ -68,7 +68,7 @@ int screen_map_load(int fd, FILE * fp)
|
||||
int parse_failed = 0;
|
||||
int is_unicode;
|
||||
|
||||
if (fstat(fp->_fileno, &stbuf))
|
||||
if (fstat(fileno(fp), &stbuf))
|
||||
perror("Cannot stat map file"), exit(1);
|
||||
|
||||
/* first try a UTF screen-map: either ASCII (no restriction) or binary (regular file) */
|
||||
|
@ -24,6 +24,14 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
#include <getopt.h>
|
||||
|
||||
/* It turns out that libc5 doesn't have this in its headers
|
||||
* even though it is actually in the lib. Force it to work */
|
||||
#if ! defined __GLIBC__ && ! defined __UCLIBC__
|
||||
#define getline __getline
|
||||
extern _IO_ssize_t getline __P ((char **, size_t *, FILE *));
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
//--------md5.c
|
||||
|
@ -55,6 +55,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <getopt.h>
|
||||
#include <pwd.h>
|
||||
|
||||
/*struct passwd *getpwnam();*/
|
||||
|
@ -56,6 +56,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <getopt.h>
|
||||
#include <pwd.h>
|
||||
|
||||
#define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
|
||||
|
5
insmod.c
5
insmod.c
@ -38,6 +38,7 @@
|
||||
#include <dirent.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
#include <getopt.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <linux/unistd.h>
|
||||
@ -71,7 +72,7 @@
|
||||
#ifndef MODUTILS_MODULE_H
|
||||
#define MODUTILS_MODULE_H 1
|
||||
|
||||
#ident "$Id: insmod.c,v 1.12 2000/07/08 18:55:24 andersen Exp $"
|
||||
#ident "$Id: insmod.c,v 1.13 2000/07/09 06:59:58 andersen Exp $"
|
||||
|
||||
/* This file contains the structures used by the 2.0 and 2.1 kernels.
|
||||
We do not use the kernel headers directly because we do not wish
|
||||
@ -277,7 +278,7 @@ int delete_module(const char *);
|
||||
#ifndef MODUTILS_OBJ_H
|
||||
#define MODUTILS_OBJ_H 1
|
||||
|
||||
#ident "$Id: insmod.c,v 1.12 2000/07/08 18:55:24 andersen Exp $"
|
||||
#ident "$Id: insmod.c,v 1.13 2000/07/09 06:59:58 andersen Exp $"
|
||||
|
||||
/* The relocatable object is manipulated using elfin types. */
|
||||
|
||||
|
@ -68,7 +68,7 @@ int screen_map_load(int fd, FILE * fp)
|
||||
int parse_failed = 0;
|
||||
int is_unicode;
|
||||
|
||||
if (fstat(fp->_fileno, &stbuf))
|
||||
if (fstat(fileno(fp), &stbuf))
|
||||
perror("Cannot stat map file"), exit(1);
|
||||
|
||||
/* first try a UTF screen-map: either ASCII (no restriction) or binary (regular file) */
|
||||
|
8
md5sum.c
8
md5sum.c
@ -24,6 +24,14 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
#include <getopt.h>
|
||||
|
||||
/* It turns out that libc5 doesn't have this in its headers
|
||||
* even though it is actually in the lib. Force it to work */
|
||||
#if ! defined __GLIBC__ && ! defined __UCLIBC__
|
||||
#define getline __getline
|
||||
extern _IO_ssize_t getline __P ((char **, size_t *, FILE *));
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
//--------md5.c
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include <dirent.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
#include <getopt.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <linux/unistd.h>
|
||||
@ -71,7 +72,7 @@
|
||||
#ifndef MODUTILS_MODULE_H
|
||||
#define MODUTILS_MODULE_H 1
|
||||
|
||||
#ident "$Id: insmod.c,v 1.12 2000/07/08 18:55:24 andersen Exp $"
|
||||
#ident "$Id: insmod.c,v 1.13 2000/07/09 06:59:58 andersen Exp $"
|
||||
|
||||
/* This file contains the structures used by the 2.0 and 2.1 kernels.
|
||||
We do not use the kernel headers directly because we do not wish
|
||||
@ -277,7 +278,7 @@ int delete_module(const char *);
|
||||
#ifndef MODUTILS_OBJ_H
|
||||
#define MODUTILS_OBJ_H 1
|
||||
|
||||
#ident "$Id: insmod.c,v 1.12 2000/07/08 18:55:24 andersen Exp $"
|
||||
#ident "$Id: insmod.c,v 1.13 2000/07/09 06:59:58 andersen Exp $"
|
||||
|
||||
/* The relocatable object is manipulated using elfin types. */
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* vi: set sw=4 ts=4: */
|
||||
/*
|
||||
* $Id: ping.c,v 1.18 2000/07/06 23:10:29 andersen Exp $
|
||||
* $Id: ping.c,v 1.19 2000/07/09 06:59:58 andersen Exp $
|
||||
* Mini ping implementation for busybox
|
||||
*
|
||||
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
|
||||
@ -51,7 +51,7 @@
|
||||
|
||||
/* It turns out that libc5 doesn't have proper icmp support
|
||||
* built into it header files, so we have to supplement it */
|
||||
#if __GNU_LIBRARY__ < 5
|
||||
#if ! defined __GLIBC__ && ! defined __UCLIBC__
|
||||
typedef unsigned int socklen_t;
|
||||
|
||||
#define ICMP_MINLEN 8 /* abs minimum */
|
||||
|
4
ping.c
4
ping.c
@ -1,6 +1,6 @@
|
||||
/* vi: set sw=4 ts=4: */
|
||||
/*
|
||||
* $Id: ping.c,v 1.18 2000/07/06 23:10:29 andersen Exp $
|
||||
* $Id: ping.c,v 1.19 2000/07/09 06:59:58 andersen Exp $
|
||||
* Mini ping implementation for busybox
|
||||
*
|
||||
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
|
||||
@ -51,7 +51,7 @@
|
||||
|
||||
/* It turns out that libc5 doesn't have proper icmp support
|
||||
* built into it header files, so we have to supplement it */
|
||||
#if __GNU_LIBRARY__ < 5
|
||||
#if ! defined __GLIBC__ && ! defined __UCLIBC__
|
||||
typedef unsigned int socklen_t;
|
||||
|
||||
#define ICMP_MINLEN 8 /* abs minimum */
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <sys/param.h>
|
||||
#include <linux/unistd.h>
|
||||
|
||||
#if __GNU_LIBRARY__ < 5
|
||||
#if ! defined __GLIBC__ && ! defined __UCLIBC__
|
||||
|
||||
typedef unsigned int socklen_t;
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <sys/param.h>
|
||||
#include <linux/unistd.h>
|
||||
|
||||
#if __GNU_LIBRARY__ < 5
|
||||
#if ! defined __GLIBC__ && ! defined __UCLIBC__
|
||||
|
||||
typedef unsigned int socklen_t;
|
||||
|
||||
|
@ -55,6 +55,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <getopt.h>
|
||||
#include <pwd.h>
|
||||
|
||||
/*struct passwd *getpwnam();*/
|
||||
|
@ -56,6 +56,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <getopt.h>
|
||||
#include <pwd.h>
|
||||
|
||||
#define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
|
||||
|
Loading…
Reference in New Issue
Block a user