#undef flock (LP: #912691)

This commit is contained in:
tg 2012-03-27 22:41:17 +00:00
parent 95a2c63096
commit 340cd95cf0
2 changed files with 11 additions and 4 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.518 2012/03/27 22:36:48 tg Exp $'
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.519 2012/03/27 22:41:16 tg Exp $'
#-
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012
@ -1335,7 +1335,7 @@ else
#define EXTERN
#define MKSH_INCLUDES_ONLY
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.518 2012/03/27 22:36:48 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.519 2012/03/27 22:41:16 tg Exp $");
int main(void) { printf("Hello, World!\n"); return (0); }
EOF
case $cm in
@ -1401,11 +1401,13 @@ EOF
#
ac_test flock <<-'EOF'
#include <fcntl.h>
#undef flock
int main(void) { return (flock(0, LOCK_EX | LOCK_UN)); }
EOF
ac_test lock_fcntl '!' flock 1 'whether we can lock files with fcntl' <<-'EOF'
#include <fcntl.h>
#undef flock
int main(void) {
struct flock lks;
lks.l_type = F_WRLCK | F_UNLCK;

9
sh.h
View File

@ -152,7 +152,7 @@
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.531 2012/03/27 22:36:53 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.532 2012/03/27 22:41:17 tg Exp $");
#endif
#define MKSH_VERSION "R40 2012/03/27"
@ -204,6 +204,12 @@ typedef unsigned long rlim_t;
typedef void (*sig_t)(int);
#endif
/* un-do vendor damage */
#undef BAD /* AIX defines that somewhere */
#undef flock /* SCO UnixWare defines that to flock64 but ENOENT */
#ifndef MKSH_INCLUDES_ONLY
/* extra types */
@ -296,7 +302,6 @@ struct rusage {
#endif
#endif
#undef BAD /* AIX defines that somewhere */
/* OS-dependent additions (functions, variables, by OS) */