Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[vdr] Re: Problems with exit-states (now VDR-1.2.4)
Steffen Barszus wrote:
>
> [ exit code ]
>
> That was indeed helpfull. I have taken your advice and made a su vdr
> (the vdr user, to not let run vdr as root, as vdr has a network socket
> and could be attacked)
>
> bash-2.05b$ vdr -t /dev/tty12
> passed line 324
> passed line 326
> Segmentation fault
> bash-2.05b$ echo $?
> 139
>
> So vdr segfaults and 139 seems to be the standard exitcode for that.
>
> With the third freopen commented out:
>
> stdin = freopen(Terminal, "r", stdin);
> fprintf(stderr, "passed line %d\n", __LINE__);
> stdout = freopen(Terminal, "w", stdout);
> fprintf(stderr, "passed line %d\n", __LINE__);
> //stderr = freopen(Terminal, "w", stderr);
> fprintf(stderr, "passed line %d\n", __LINE__);
>
> It doesn't segfault anymore. I had the feeling yesterday night that i
> had mixed two problems :) Thanks for your help. It doesn seem to be a
> problem with exitcodes, its just that vdr segfaults with -t /dev/ttyx
> as user != root . This is because the user does not have write access
> to the console :( and this does not got catched by vdr. Since there is
> nothing to write on stdout , vdr doesn't segfault there, but vdr has
> something to write to stderr (the error i made in my config to test the
> exit states). Thus it segfaults on that place. Good that i had some
> sleep and your explanation. I guess this makes things for Klaus now a
> lot easier ;) then the testing w/o a target i made before. With knowing
> the problem i can handle the other problems
Please try this:
--- vdr.c 2003/08/24 11:18:04 1.166
+++ vdr.c 2003/09/03 16:17:09
@@ -199,6 +199,10 @@
case 's': Shutdown = optarg;
break;
case 't': Terminal = optarg;
+ if (access(Terminal, R_OK | W_OK) < 0) {
+ fprintf(stderr, "vdr: can't access terminal: %s\n", Terminal);
+ return 2;
+ }
break;
case 'V': DisplayVersion = true;
break;
Haven't tested it here, but I would hope this catches the problem.
Klaus
--
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.
Home |
Main Index |
Thread Index