(tgets): avoid be clobbered by longjmp' or
vfork' warning
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12720 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -38,10 +38,12 @@ tgets(char *str, int size, FILE *fp, int timeout)
|
||||
{
|
||||
signal(SIGALRM, ring);
|
||||
alarm(timeout);
|
||||
if (setjmp(env))
|
||||
str = NULL;
|
||||
else
|
||||
str = fgets(str,size,fp);
|
||||
if (setjmp(env)) {
|
||||
alarm(0);
|
||||
signal(SIGALRM,SIG_DFL);
|
||||
return NULL;
|
||||
}
|
||||
fgets(str,size,fp);
|
||||
alarm(0);
|
||||
signal(SIGALRM,SIG_DFL);
|
||||
return(str);
|
||||
|
Reference in New Issue
Block a user