Branch: Tag:

1999-09-25

1999-09-25 19:54:48 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Fixed an fd leak, and a warning.

Rev: src/modules/Image/font.c:1.55

1: - /* $Id: font.c,v 1.54 1999/09/14 13:55:08 mirar Exp $ */ + /* $Id: font.c,v 1.55 1999/09/25 19:54:48 grubba Exp $ */   #include "global.h"      #define SPACE_CHAR 'i'
9:   /*   **! module Image   **! note - **! $Id: font.c,v 1.54 1999/09/14 13:55:08 mirar Exp $ + **! $Id: font.c,v 1.55 1999/09/25 19:54:48 grubba Exp $   **! class Font   **!   **! note
341:      void font_load(INT32 args)   { -  int fd; +  int fd = -1;    size_t size;       if (THIS)
367:    fprintf(stderr,"FONT open '%s'\n",sp[-args].u.string->str);   #endif    fd = fd_open(sp[-args].u.string->str,fd_RDONLY,0); +  /* FIXME: check_threads_etc(); ? +  */    } while(fd < 0 && errno == EINTR);       if (fd >= 0)
473:   #endif    free_font_struct(new_font);    THIS=NULL; +  if (fd >= 0) { +  fd_close(fd); +  }    pop_n_elems(args);    push_int(0);    return;