[so2] [Tema4] Test test_proc_entry_inexistent_after_rmmod gresit

Alexandru Elisei alexandru.elisei at gmail.com
Thu May 17 17:38:25 EEST 2018


Din man file:

EXIT STATUS
file will exit with 0 if the operation was successful or >0 if an
error was encountered.  The following errors cause diagnostic
messages, but don't affect the program exit code (as POSIX requires),
unless -E is specified:
           o   A file cannot be found
           o   There is no permission to read a file
           o   The file type cannot be determined

file va iesi cu 0 daca fisierul nu exista.

Testat de mana:

root at qemux86:~# insmod af_stp.ko;rmmod af_stp.ko; file
/proc/net/stp_stats; echo $?
/proc/net/stp_stats: cannot open `/proc/net/stp_stats' (No such file
or directory)
0
root at qemux86:~#

Modificat linia 145 si adaugat optiunea -E:

rc = system("file -E " STP_PROC_FULL_FILENAME " > /dev/null 2>&1");

testul trece.


More information about the so2 mailing list