pike.git / src / lex.c

version» Context lines:

pike.git/src/lex.c:20:   #include "operators.h"   #include "opcodes.h"   #include "builtin_efuns.h"      #include "macros.h"   #include <sys/param.h>   #include <ctype.h>   #include <math.h>   #include <fcntl.h>   #include <errno.h> + #ifdef HAVE_TIME_H   #include <time.h> -  + #endif      #define LEXDEBUG 0   #define EXPANDMAX 50000      struct lpc_string *current_file;      INT32 current_line;   INT32 old_line;   INT32 total_lines;   INT32 nexpands;
pike.git/src/lex.c:356:      static void link_inputstate(struct inputstate *i)   {    i->next=istate;    istate=i;   }      static void free_inputstate(struct inputstate *i)   {    if(!i) return; -  if(i->fd>=0) close(i->fd); +  if(i->fd>=0) +  { +  retry: +  if(close(i->fd)< 0) +  if(errno == EINTR) +  goto retry; +  }    if(i->data && !i->dont_free_data) free(i->data);    free_inputstate(i->next);    free((char *)i);   }      static struct inputstate *new_inputstate();   static struct inputstate *memory_inputstate(INT32 size);      static int default_gobble(int c)   {
pike.git/src/lex.c:939:    reference_shared_string(current_file);       SAFE_APPLY_MASTER("handle_include",2);       if(sp[-1].type != T_STRING)    {    my_yyerror("Couldn't include file '%s'.",name);    return;    }    +  retry:    fd=open(sp[-1].u.string->str,O_RDONLY);    if(fd < 0)    { -  +  if(errno == EINTR) goto retry; +     my_yyerror("Couldn't open file to include '%s'.",sp[-1].u.string->str);    return;    }       UNGETSTR("\" 2",3);    UNGETSTR(current_file->str,current_file->len);    sprintf(buf,"\n# %ld \"",(long)current_line+1);    UNGETSTR(buf,strlen(buf));       total_lines+=current_line-old_line;