delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/08/22/08:41:49

Message-ID: <39A275AD.31F59BA0@softhome.net>
Date: Tue, 22 Aug 2000 14:44:29 +0200
From: Laurynas Biveinis <lauras AT softhome DOT net>
X-Mailer: Mozilla 4.74 [en] (Win98; U)
X-Accept-Language: lt,en
MIME-Version: 1.0
To: DJGPP Workers <djgpp-workers AT delorie DOT com>
Subject: Patch: symlinks in _dxe_load()
Reply-To: djgpp-workers AT delorie DOT com

Actually I've finished integrating my patch, now I'm browsing
through libc souces and looking for anything unhandled. One
thing I've found that _dxe_load is using _open(). IMHO open()
does better with symlinks. Change tested, it works.

Any comments?
Laurynas

Index: dxeload.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/dxe/dxeload.c,v
retrieving revision 1.2
diff -u -r1.2 dxeload.c
--- dxeload.c	1996/04/26 18:52:54	1.2
+++ dxeload.c	2000/08/22 12:39:48
@@ -2,10 +2,12 @@
    This software may be freely distributed with above copyright, no warranty.
    Based on code by DJ Delorie, it's really his, enhanced, bugs fixed. */
 
+#include <fcntl.h>
 #include <io.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <sys/dxe.h>
+#include <sys/stat.h>
 
 void *_dxe_load(char *name)
 {
@@ -13,7 +15,7 @@
   char *data;
   int h;
 
-  h = _open(name, 0);
+  h = open(name, O_RDONLY);
   if (h < 0)
     return 0;
   _read(h, &dh, sizeof(dh));

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019