#include <stdio.h>
#include <errno.h>
-#ifndef __GLIBC__
-/* BSD 4.3 errno.h does not declare errno */
-extern int errno;
-extern int sys_nerr;
-extern char *sys_errlist[];
-#endif
-
#include <sys/param.h>
#include <X11/cursorfont.h>
#include <X11/Intrinsic.h>
#define MAXPATHLEN 1024
#endif /* ndef MAXPATHLEN */
-#if !defined(SVR4) && !defined(SYSV) && !defined(USG)
-extern char *getwd();
-#endif /* !defined(SVR4) && !defined(SYSV) && !defined(USG) */
-
int SFstatus = SEL_FILE_NULL;
char
SFchdir(SFstartDir);
if ((fp = fopen(name, mode)) == NULL) {
char *buf;
- if (errno <= sys_nerr) {
- buf = XtMalloc(strlen(failed) + strlen(sys_errlist[errno]) +
- strlen(prompt) + 2);
- strcpy(buf, failed);
- strcat(buf, sys_errlist[errno]);
- strcat(buf, "\n");
- strcat(buf, prompt);
- } else {
- buf = XtMalloc(strlen(failed) + strlen(prompt) + 2);
- strcpy(buf, failed);
- strcat(buf, "\n");
- strcat(buf, prompt);
- }
+ buf = XtMalloc(strlen(failed) + strlen(strerror(errno))
+ + strlen(prompt) + 2);
+ strcpy(buf, failed);
+ strcat(buf, strerror(errno));
+ strcat(buf, "\n");
+ strcat(buf, prompt);
+
XtSetArg(args[0], XtNlabel, buf);
XtSetValues(selFilePrompt, args, 1);
XtFree(buf);
SFpositionWidget(selFile);
XtMapWidget(selFile);
-#if defined(SVR4) || defined(SYSV) || defined(USG)
if (!getcwd(SFstartDir, MAXPATHLEN)) {
-#else /* defined(SVR4) || defined(SYSV) || defined(USG) */
- if (!getwd(SFstartDir)) {
-#endif /* defined(SVR4) || defined(SYSV) || defined(USG) */
-
XtAppError(SFapp, "XsraSelFile: can't get current directory");
}
(void) strcat(SFstartDir, "/");