From: Jim Meyering Date: Thu, 18 Jan 2007 16:19:13 +0000 (+0000) Subject: Use "$(MKDIR_P) sys", not race-prone "test -d sys || mkdir sys". X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aeb8c436374844c89da703fa45374f4c653ed3bd;p=pspp Use "$(MKDIR_P) sys", not race-prone "test -d sys || mkdir sys". * modules/sys_stat (Makefile.am): Use "$(MKDIR_P) sys", rather than the race-prone "test -d sys || mkdir sys". (configure.ac): Use AC_PROG_MKDIR_P. * modules/sys_select: Likewise. * modules/sys_socket: Likewise. * modules/sys_time: Likewise. --- diff --git a/ChangeLog b/ChangeLog index 6aabd47de0..8825af1e2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-01-18 Jim Meyering + + Use "$(MKDIR_P) sys", not race-prone "test -d sys || mkdir sys". + * modules/sys_stat (Makefile.am): Use "$(MKDIR_P) sys", rather + than the race-prone "test -d sys || mkdir sys". + (configure.ac): Use AC_PROG_MKDIR_P. + * modules/sys_select: Likewise. + * modules/sys_socket: Likewise. + * modules/sys_time: Likewise. + 2007-01-18 Eric Blake * m4/gettimeofday.m4 (gl_GETTIMEOFDAY_REPLACE_LOCALTIME): Also diff --git a/modules/sys_select b/modules/sys_select index 76ae6f9a5e..3319c3cd8a 100644 --- a/modules/sys_select +++ b/modules/sys_select @@ -9,6 +9,7 @@ sys_socket configure.ac: gl_HEADER_SYS_SELECT +AC_PROG_MKDIR_P Makefile.am: BUILT_SOURCES += $(SYS_SELECT_H) @@ -16,7 +17,7 @@ BUILT_SOURCES += $(SYS_SELECT_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. sys/select.h: - test -d sys || mkdir sys + $(MKDIR_P) sys rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ echo '#include '; \ diff --git a/modules/sys_socket b/modules/sys_socket index 47d113cdf0..6b75a4e938 100644 --- a/modules/sys_socket +++ b/modules/sys_socket @@ -10,6 +10,7 @@ Depends-on: configure.ac: gl_HEADER_SYS_SOCKET +AC_PROG_MKDIR_P Makefile.am: BUILT_SOURCES += $(SYS_SOCKET_H) @@ -17,7 +18,7 @@ BUILT_SOURCES += $(SYS_SOCKET_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. sys/socket.h: socket_.h - test -d sys || mkdir sys + $(MKDIR_P) sys { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ cat $(srcdir)/socket_.h; \ } > $@-t diff --git a/modules/sys_stat b/modules/sys_stat index 95ed32ba55..1b07c854f0 100644 --- a/modules/sys_stat +++ b/modules/sys_stat @@ -10,6 +10,7 @@ absolute-header configure.ac: gl_HEADER_SYS_STAT_H +AC_PROG_MKDIR_P Makefile.am: BUILT_SOURCES += $(SYS_STAT_H) @@ -17,7 +18,7 @@ BUILT_SOURCES += $(SYS_STAT_H) # We need the following in order to create when the system # has one that is incomplete. sys/stat.h: stat_.h - test -d sys || mkdir sys + $(MKDIR_P) sys rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''ABSOLUTE_SYS_STAT_H''@|$(ABSOLUTE_SYS_STAT_H)|g' \ diff --git a/modules/sys_time b/modules/sys_time index 16a227eb2b..48e4941ca8 100644 --- a/modules/sys_time +++ b/modules/sys_time @@ -10,6 +10,7 @@ absolute-header configure.ac: gl_HEADER_SYS_TIME_H +AC_PROG_MKDIR_P Makefile.am: BUILT_SOURCES += sys/time.h @@ -17,7 +18,7 @@ BUILT_SOURCES += sys/time.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. sys/time.h: sys_time_.h - test -d sys || mkdir sys + $(MKDIR_P) sys rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \