Diff

Differences From Artifact [eb6045d73e]:

To Artifact [c4ab7f645d]:


43
44
45
46
47
48
49





50
51
52
53
54
55
56
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61







+
+
+
+
+







#include <stdlib.h>
#include <string.h>
#include <netdb.h>
#include <errno.h>
#include <stdio.h>
#include "parse.h"
#include "crc.h"

#ifndef O_BINARY
#define O_BINARY 0x0
#endif


//extern int errno;
struct dact_url_info {
	char *url;
	int flags;
	mode_t mode;
};
286
287
288
289
290
291
292
293

294
295
296
297
298
299
300
291
292
293
294
295
296
297

298
299
300
301
302
303
304
305







-
+







				
				break;
		}

		free(read_buf_s);
		close(fd);
	} else {
		fd=open(pathname,flags,mode);
		fd=open(pathname,flags|O_BINARY,mode);
		if (dact_urls[fd].url!=NULL) free(dact_urls[fd].url);
		dact_urls[fd].url=strdup(pathname);
		dact_urls[fd].flags=flags;
		dact_urls[fd].mode=mode;
		return(fd);
	}

315
316
317
318
319
320
321




322
323
324
325
326

327
328
329
330
331
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334

335
336
337
338
339
340







+
+
+
+




-
+





		dup2(newfd,filedes);
		return(0);
	}
	return(lseek(filedes,offset,whence));
}

#else
#ifndef O_BINARY
#define O_BINARY 0x0
#endif

int createlisten(int port) { return(-1); }
void closeconnection(int sockfd) { return; }
int createconnection_tcp(char *host, int port) { return(-1); }
int open_net(const char *pathname, int flags, mode_t mode) {
	return(open(pathname,flags,mode));
	return(open(pathname,flags|O_BINARY,mode));
}
off_t lseek_net(int filedes, off_t offset, int whence) {
	return(lseek(filedes,offset,whence));
}
#endif