* add definition of __RCSID if not yet existant (GNU/Linux)

* add declarations of strlcpy and strlcat (for GNU/Linux, again)
* always include <sys/resource.h>
* some more compile / warning fixes
This commit is contained in:
tg 2005-05-23 14:19:14 +00:00
parent f7402a2cc8
commit 8266c126ac
3 changed files with 18 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/** $MirOS: src/bin/mksh/funcs.c,v 1.1 2005/05/23 03:06:07 tg Exp $ */ /** $MirOS: src/bin/mksh/funcs.c,v 1.2 2005/05/23 14:19:13 tg Exp $ */
/* $OpenBSD: c_ksh.c,v 1.27 2005/03/30 17:16:37 deraadt Exp $ */ /* $OpenBSD: c_ksh.c,v 1.27 2005/03/30 17:16:37 deraadt Exp $ */
/* $OpenBSD: c_sh.c,v 1.29 2005/03/30 17:16:37 deraadt Exp $ */ /* $OpenBSD: c_sh.c,v 1.29 2005/03/30 17:16:37 deraadt Exp $ */
/* $OpenBSD: c_test.c,v 1.17 2005/03/30 17:16:37 deraadt Exp $ */ /* $OpenBSD: c_test.c,v 1.17 2005/03/30 17:16:37 deraadt Exp $ */
@ -7,14 +7,13 @@
#include "sh.h" #include "sh.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/time.h> #include <sys/time.h>
#if defined(__OpenBSD__)
#include <sys/resource.h> #include <sys/resource.h>
#else #include <ctype.h>
#if !defined(__OpenBSD__)
#include <ulimit.h> #include <ulimit.h>
#endif #endif
#include <ctype.h>
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.1 2005/05/23 03:06:07 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.2 2005/05/23 14:19:13 tg Exp $");
int int
c_cd(char **wp) c_cd(char **wp)

View File

@ -1,4 +1,4 @@
/** $MirOS: src/bin/mksh/histrap.c,v 1.3 2005/05/23 12:06:39 tg Exp $ */ /** $MirOS: src/bin/mksh/histrap.c,v 1.4 2005/05/23 14:19:14 tg Exp $ */
/* $OpenBSD: history.c,v 1.30 2005/03/30 17:16:37 deraadt Exp $ */ /* $OpenBSD: history.c,v 1.30 2005/03/30 17:16:37 deraadt Exp $ */
/* $OpenBSD: trap.c,v 1.22 2005/03/30 17:16:37 deraadt Exp $ */ /* $OpenBSD: trap.c,v 1.22 2005/03/30 17:16:37 deraadt Exp $ */
@ -8,7 +8,7 @@
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/stat.h> #include <sys/stat.h>
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.3 2005/05/23 12:06:39 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.4 2005/05/23 14:19:14 tg Exp $");
static int histfd; static int histfd;
static int hsize; static int hsize;
@ -975,7 +975,7 @@ mksh_signame(int s)
static const struct _mksh_sigpair { static const struct _mksh_sigpair {
int nr; int nr;
const char *name; const char *name;
} const mksh_sigpair[] = { } mksh_sigpair[] = {
#include "signames.inc" #include "signames.inc"
{ 0, NULL } { 0, NULL }
}; };

13
sh.h
View File

@ -1,4 +1,4 @@
/** $MirOS: src/bin/mksh/sh.h,v 1.1 2005/05/23 03:06:09 tg Exp $ */ /** $MirOS: src/bin/mksh/sh.h,v 1.2 2005/05/23 14:19:14 tg Exp $ */
/* $OpenBSD: sh.h,v 1.27 2005/03/28 21:33:04 deraadt Exp $ */ /* $OpenBSD: sh.h,v 1.27 2005/03/28 21:33:04 deraadt Exp $ */
/* $OpenBSD: shf.h,v 1.5 2005/03/30 17:16:37 deraadt Exp $ */ /* $OpenBSD: shf.h,v 1.5 2005/03/30 17:16:37 deraadt Exp $ */
/* $OpenBSD: table.h,v 1.6 2004/12/18 20:55:52 millert Exp $ */ /* $OpenBSD: table.h,v 1.6 2004/12/18 20:55:52 millert Exp $ */
@ -38,10 +38,14 @@
#include <sys/types.h> #include <sys/types.h>
#if defined(__gnu_linux__) #if defined(__gnu_linux__) && !defined(_POSIX_SOURCE)
#define _POSIX_SOURCE #define _POSIX_SOURCE
#endif #endif
#ifndef __RCSID
#define __RCSID(x) static const char __rcsid[] __attribute__((used)) = (x)
#endif
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <limits.h> #include <limits.h>
@ -1288,4 +1292,9 @@ extern void tty_close(void);
#endif #endif
#undef I__ #undef I__
#if defined(__gnu_linux__)
size_t strlcat(char *, const char *, size_t);
size_t strlcpy(char *, const char *, size_t);
#endif
#endif #endif