OS/2's stat() doesn't like paths that have a trailing / so remove it.

Use nsinstall from $PATH rather than dist/bin
Thanks to Javier Pedemonte <pedemont@us.ibm.com> for the patch.
Bug #169564 r=cls
This commit is contained in:
seawood%netscape.com 2002-09-19 19:48:23 +00:00
parent 1fa96aa20f
commit 2e912835a0
2 changed files with 8 additions and 5 deletions

View File

@ -769,7 +769,7 @@ endif
GARBAGE += $(DEPENDENCIES) $(MKDEPENDENCIES) $(MKDEPENDENCIES).bak core $(wildcard core.[0-9]*) $(wildcard *.err) $(wildcard *.pure) $(wildcard *_pure_*.o) Templates.DB
ifeq (,$(filter-out WINNT, $(OS_ARCH)))
ifeq (,$(filter-out WINNT OS2, $(OS_ARCH)))
ifeq ($(OS_ARCH),WINNT)
NSINSTALL = $(CYGWIN_WRAPPER) $(MOZ_TOOLS_DIR)/bin/nsinstall
else

View File

@ -74,7 +74,7 @@
#endif
#ifdef XP_OS2_VACPP
getopt(int nargc, char **nargv, char *ostr);
int getopt(int nargc, char **nargv, char *ostr);
#include <dirent.h>
#include <direct.h>
#include <io.h>
@ -118,9 +118,6 @@ extern int fchmod(int fildes, mode_t mode);
/*looks reasonably safe based on OS/2's stat.h...*/
#define S_ISLNK(mode) 0 /*no way in hell on a file system that doesn't support it*/
#ifdef XP_OS2_VACPP
typedef unsigned short mode_t;
typedef unsigned short uid_t;
typedef unsigned short gid_t;
#define mkdir(path, mode) mkdir(path)
#define W_OK 1
#endif /* XP_OS2_VACPP */
@ -418,6 +415,12 @@ main(int argc, char **argv)
usage();
todir = argv[argc-1];
#ifdef XP_OS2_VACPP
/* The stat() function in OS/2 Visual Age C++ doesn't like a path with
a trailing backslash. */
if (todir[strlen(todir)-1] == '/')
todir[strlen(todir)-1] = '/0';
#endif
if ((stat(todir, &sb) < 0 || !S_ISDIR(sb.st_mode)) &&
mkdirs(todir, 0777) < 0) {
fail("cannot make directory %s", todir);