endian filesystems (from mycroft)
SCCS-vsn: sbin/fsck/pass2.c 8.6
-static char sccsid[] = "@(#)pass2.c 8.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)pass2.c 8.6 (Berkeley) %G%";
#endif /* not lint */
#include <sys/param.h>
#endif /* not lint */
#include <sys/param.h>
proto.d_type = 0;
proto.d_namlen = 1;
(void)strcpy(proto.d_name, ".");
proto.d_type = 0;
proto.d_namlen = 1;
(void)strcpy(proto.d_name, ".");
+# if BYTE_ORDER == LITTLE_ENDIAN
+ if (!newinofmt) {
+ u_char tmp;
+
+ tmp = proto.d_type;
+ proto.d_type = proto.d_namlen;
+ proto.d_namlen = tmp;
+ }
+# endif
entrysize = DIRSIZ(0, &proto);
if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") != 0) {
pfatal("CANNOT FIX, FIRST ENTRY IN DIRECTORY CONTAINS %s\n",
entrysize = DIRSIZ(0, &proto);
if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") != 0) {
pfatal("CANNOT FIX, FIRST ENTRY IN DIRECTORY CONTAINS %s\n",
proto.d_type = 0;
proto.d_namlen = 2;
(void)strcpy(proto.d_name, "..");
proto.d_type = 0;
proto.d_namlen = 2;
(void)strcpy(proto.d_name, "..");
+# if BYTE_ORDER == LITTLE_ENDIAN
+ if (!newinofmt) {
+ u_char tmp;
+
+ tmp = proto.d_type;
+ proto.d_type = proto.d_namlen;
+ proto.d_namlen = tmp;
+ }
+# endif
entrysize = DIRSIZ(0, &proto);
if (idesc->id_entryno == 0) {
n = DIRSIZ(0, dirp);
entrysize = DIRSIZ(0, &proto);
if (idesc->id_entryno == 0) {
n = DIRSIZ(0, dirp);