[quake3-bugzilla] [Bug 5080] New: [patch] code/sys/sys_unix.c:Sys_Dialog doesn't check exit codes properly
bugzilla-daemon at icculus.org
bugzilla-daemon at icculus.org
Thu Jul 14 20:42:15 EDT 2011
https://bugzilla.icculus.org/show_bug.cgi?id=5080
Summary: [patch] code/sys/sys_unix.c:Sys_Dialog doesn't check
exit codes properly
Product: ioquake3
Version: SVN HEAD
Platform: All
OS/Version: Linux
Status: NEW
Severity: minor
Priority: P3
Component: Misc
AssignedTo: zakk at icculus.org
ReportedBy: q3urt.undead at gmail.com
QAContact: quake3-bugzilla at icculus.org
Created attachment 2837
--> https://bugzilla.icculus.org/attachment.cgi?id=2837
Make Sys_Dialog try executables that exist
There are a few problems with the Sys_Dialog function.
1) It assumes that 1=error, 0=success. That may be true of the command itself,
but it doesn't necessarily apply to the shell. System() will return 127 when
the shell fails including when the file is not present.
2) There aren't enough checks in Sys_Dialog to detect if a program was started
up properly. It only has DT_YES_NO and DT_OK_CANCEL and assumes the others are
ok. In my case, I don't have zenity and is assumed to be DR_OK. Even if it
did have a check, it wouldn't properly detect the error due to #1 above.
The attached patch checks for the command in the path. With this patch, it
skips zenity and kdialog and properly displays with xmessage for me.
vanilla r2080 when I execute in a directory without anything quake3 related
(fails to find pak0.pk3 which should be an error). There is an error message
about not finding zenity and it never displays anything. It should use
xmessage since I have that installed.
$ ./ioquake3_r2080_vanilla.i386
ioq3 1.36_SVN2080 linux-i386 Jul 14 2011
Have SSE support
----- FS_Startup -----
Current search path:
/home/undead/.q3a/baseq3
./baseq3
----------------------
0 files in pk3 files
"pak0.pk3" is missing. Please copy it from your legitimate Q3 CDROM. Point
Release files are missing. Please re-install the 1.32 point release. Also check
that your ioq3 executable is in the correct place and that every file in the
"baseq3" directory is present and readable
sh: zenity: not found
patched r2080 where it pops up with xmessage:
$ ./ioquake3_r2080_dialog.i386
ioq3 1.36_SVN2080 linux-i386 Jul 14 2011
Have SSE support
----- FS_Startup -----
Current search path:
/home/undead/.q3a/baseq3
./baseq3
----------------------
0 files in pk3 files
"pak0.pk3" is missing. Please copy it from your legitimate Q3 CDROM. Point
Release files are missing. Please re-install the 1.32 point release. Also check
that your ioq3 executable is in the correct place and that every file in the
"baseq3" directory is present and readable
--
Configure bugmail: https://bugzilla.icculus.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the quake3-bugzilla
mailing list