printuid: fix uid_t decoding on 64-bit architectures
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 13 Dec 2014 18:24:13 +0000 (18:24 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 14 Dec 2014 03:54:04 +0000 (03:54 +0000)
commit1da7c95b62537f066c74972e2b59a322446ca86e
tree3f8f6183b37293e6b7ca17e2df1bbe80fcf58117
parent79fb4d6a9ab049d0935374226647d4b32c9c86ea
printuid: fix uid_t decoding on 64-bit architectures

It was not a good idea to treat uid_t as a long int type because
the latter is twice larger than uid_t on 64-bit architectures.

* defs.h (printuid): Change uid argument type from "unsigned long"
to "unsigned int".
* util.c (printuid): Likewise.  When uid equals to -1, print "-1".
* tests/uid.awk: New file.
* tests/uid.c: New file.
* tests/uid32.c: Likewise.
* tests/uid.test: New test.
* tests/uid32.test: Likewise.
* tests/Makefile.am (CHECK_PROGRAMS): Add uid and uid32.
(TESTS): Add uid.test and uid32.test.
(EXTRA_DIST): Add uid.awk.
* tests/.gitignore: Add uid and uid32.
defs.h
tests/.gitignore
tests/Makefile.am
tests/uid.awk [new file with mode: 0644]
tests/uid.c [new file with mode: 0644]
tests/uid.test [new file with mode: 0755]
tests/uid32.c [new file with mode: 0644]
tests/uid32.test [new file with mode: 0755]
util.c