diff options
| -rw-r--r-- | include/linux/acct.h | 8 | ||||
| -rw-r--r-- | kernel/acct.c | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/include/linux/acct.h b/include/linux/acct.h index 6c2bd56773f0..b46ce1ac1c6a 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h @@ -17,6 +17,7 @@ #include <linux/types.h> #include <asm/param.h> +#include <asm/byteorder.h> /* * comp_t is a 16-bit "floating" point number with a 3-bit base 8 @@ -104,7 +105,12 @@ struct acct_v3 #define ACOMPAT 0x04 /* ... used compatibility mode (VAX only not used) */ #define ACORE 0x08 /* ... dumped core */ #define AXSIG 0x10 /* ... was killed by a signal */ -#define ABYTESEX 0x80 /* always set, allows to detect byteorder */ + +#ifdef __BIG_ENDIAN +#define ACCT_BYTEORDER 0x80 /* accounting file is big endian */ +#else +#define ACCT_BYTEORDER 0x00 /* accounting file is little endian */ +#endif #ifdef __KERNEL__ diff --git a/kernel/acct.c b/kernel/acct.c index e55e7bba861e..daf23c4efab4 100644 --- a/kernel/acct.c +++ b/kernel/acct.c @@ -398,7 +398,7 @@ static void do_acct_process(long exitcode, struct file *file) */ memset((caddr_t)&ac, 0, sizeof(acct_t)); - ac.ac_version = ACCT_VERSION; + ac.ac_version = ACCT_VERSION | ACCT_BYTEORDER; strlcpy(ac.ac_comm, current->comm, sizeof(ac.ac_comm)); elapsed = jiffies_64_to_AHZ(get_jiffies_64() - current->start_time); @@ -441,8 +441,7 @@ static void do_acct_process(long exitcode, struct file *file) old_encode_dev(tty_devnum(current->signal->tty)) : 0; read_unlock(&tasklist_lock); - /* ABYTESEX is always set to allow byte order detection */ - ac.ac_flag = ABYTESEX; + ac.ac_flag = 0; if (current->flags & PF_FORKNOEXEC) ac.ac_flag |= AFORK; if (current->flags & PF_SUPERPRIV) |
