Build on IRIX again, fix symbol name clash with dirname.

Merge of xfs-cmds-melb:slinx:20143a by kenmcd.
This commit is contained in:
Nathan Scott
2004-11-15 13:50:09 +00:00
parent 68c295a477
commit 87ad2cc6f0
+11 -9
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. * Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved.
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as * under the terms of version 2 of the GNU General Public License as
@@ -43,7 +43,9 @@
#include <unistd.h> #include <unistd.h>
#define MAXNAMELEN 256 #define MAXNAMELEN 256
#ifndef __sgi__
typedef unsigned int uint_t; typedef unsigned int uint_t;
#endif
/* /*
* Loop over directory sizes: * Loop over directory sizes:
@@ -59,7 +61,7 @@ typedef unsigned int uint_t;
static uint_t addval; static uint_t addval;
static uint_t dirchars; static uint_t dirchars;
static char *dirname; static char *directory;
static uint_t firstsize; static uint_t firstsize;
static uint_t lastsize; static uint_t lastsize;
static uint_t minchars; static uint_t minchars;
@@ -106,7 +108,7 @@ main(int argc, char **argv)
nchars = (uint_t)atoi(optarg); nchars = (uint_t)atoi(optarg);
break; break;
case 'd': case 'd':
dirname = optarg; directory = optarg;
break; break;
case 'f': case 'f':
firstsize = (uint_t)atoi(optarg); firstsize = (uint_t)atoi(optarg);
@@ -137,15 +139,15 @@ main(int argc, char **argv)
} }
if (stats == 0) if (stats == 0)
stats = 1; stats = 1;
if (!dirname) if (!directory)
dirname = "."; directory = ".";
else { else {
if (mkdir(dirname, 0777) < 0 && errno != EEXIST) { if (mkdir(directory, 0777) < 0 && errno != EEXIST) {
perror(dirname); perror(directory);
exit(1); exit(1);
} }
if (chdir(dirname) < 0) { if (chdir(directory) < 0) {
perror(dirname); perror(directory);
exit(1); exit(1);
} }
} }