/* bug workarounds if needed */
int decc_bug_readdir_efs1 = 0;
-int decc_bug_devnull = 0;
+int decc_bug_devnull = 1;
int decc_bug_fgetname = 0;
int decc_dir_barename = 0;
if (!fp) return 0;
fstat(fileno(fp), (struct stat *)&s1);
- #if defined(_USE_STD_STAT)
- cmp_result = s0.crtl_stat.st_ino != s1.crtl_stat.st_ino;
- #else
- cmp_result = memcmp(s0.crtl_stat.st_ino, s1.crtl_stat.st_ino, 6);
- #endif
+ cmp_result = VMS_INO_T_COMPARE(s0.crtl_stat.st_ino, s1.crtl_stat.st_ino);
if ((cmp_result != 0) && (s0.st_ctime != s1.st_ctime)) {
fclose(fp);
return 0;
const char *name;
{
if (decc_bug_devnull != 0) {
- if (strcmp("/dev/null", name) == 0) /* temp hack */
+ if (strncmp("/dev/null", name, 9) == 0)
return 1;
}
/* The VMS null device is named "_NLA0:", usually abbreviated as "NL:".
if (cptr == NULL)
namecache[0] = '\0';
}
-#ifdef _USE_STD_STAT
- memcpy(&statbufp->st_ino, &statbufp->crtl_stat.st_ino, 8);
-#else
- memcpy(&statbufp->st_ino, statbufp->crtl_stat.st_ino, 8);
-#endif
+
+ VMS_INO_T_COPY(statbufp->st_ino, statbufp->crtl_stat.st_ino);
#ifndef _USE_STD_STAT
strncpy(statbufp->st_devnam, statbufp->crtl_stat.st_dev, 63);
statbufp->st_devnam[63] = 0;
}
#endif
if (!retval) {
-#ifdef _USE_STD_STAT
- memcpy(&statbufp->st_ino, &statbufp->crtl_stat.st_ino, 8);
-#else
- memcpy(&statbufp->st_ino, statbufp->crtl_stat.st_ino, 8);
-#endif
+ VMS_INO_T_COPY(statbufp->st_ino, statbufp->crtl_stat.st_ino);
#ifndef _USE_STD_STAT
strncpy(statbufp->st_devnam, statbufp->crtl_stat.st_dev, 63);
statbufp->st_devnam[63] = 0;
}
/* PCP mode requires creating /dev/null special device file */
- decc_bug_devnull = 0;
+ decc_bug_devnull = 1;
status = sys_trnlnm("DECC_BUG_DEVNULL", val_str, sizeof(val_str));
if ($VMS_STATUS_SUCCESS(status)) {
if ((val_str[0] == 'E') || (val_str[0] == '1') || (val_str[0] == 'T'))
decc_bug_devnull = 1;
+ else
+ decc_bug_devnull = 0;
}
/* fgetname returning a VMS name in UNIX mode */
#define st_fab_rfm crtl_stat.st_fab_rfm
#define st_fab_rat crtl_stat.st_fab_rat
#define st_fab_fsz crtl_stat.st_fab_fsz
-#define st_fab_mrs crtl_stat_st_fab_mrs
+#define st_fab_mrs crtl_stat.st_fab_mrs
+
+#ifdef _USE_STD_STAT
+#define VMS_INO_T_COMPARE(__a, __b) (__a != __b)
+#define VMS_INO_T_COPY(__a, __b) a = b
+#else
+#define VMS_INO_T_COMPARE(__a, __b) memcmp(&__a, &__b, 6)
+#define VMS_INO_T_COPY(__a, __b) memcpy(&__a, &__b, 6)
+#endif
#if defined(__DECC) || defined(__DECCXX)
# pragma __member_alignment __restore