mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-22 15:47:37 +00:00
Fix endian bug introduced at Berkeley during the Net2->4.4-lite transition.
Fix is courtesy of the NetBSD folks. Reviewed by: pst
This commit is contained in:
parent
3ce94772cc
commit
a7ab72edf1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=2558
@ -56,6 +56,8 @@ static char sccsid[] = "@(#)dirs.c 8.2 (Berkeley) 1/21/94";
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <machine/endian.h>
|
||||
|
||||
#include "pathnames.h"
|
||||
#include "restore.h"
|
||||
#include "extern.h"
|
||||
@ -348,14 +350,16 @@ putdir(buf, size)
|
||||
} else {
|
||||
for (loc = 0; loc < size; ) {
|
||||
dp = (struct direct *)(buf + loc);
|
||||
if (oldinofmt) {
|
||||
if (Bcvt) {
|
||||
swabst((u_char *)"l2s", (u_char *) dp);
|
||||
}
|
||||
} else {
|
||||
if (Bcvt) {
|
||||
swabst((u_char *)"ls", (u_char *) dp);
|
||||
}
|
||||
if (Bcvt)
|
||||
swabst((u_char *)"ls", (u_char *) dp);
|
||||
if (oldinofmt && dp->d_ino != 0) {
|
||||
#if BYTE_ORDER == BIG_ENDIAN
|
||||
if (Bcvt)
|
||||
#else
|
||||
if (!Bcvt)
|
||||
#endif
|
||||
dp->d_namlen = dp->d_type;
|
||||
dp->d_type = DT_UNKNOWN;
|
||||
}
|
||||
i = DIRBLKSIZ - (loc & (DIRBLKSIZ - 1));
|
||||
if ((dp->d_reclen & 0x3) != 0 ||
|
||||
|
Loading…
Reference in New Issue
Block a user