vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, This patch makes lseek use SEEK_SET instead of 0. Best regards, Charles Longeau Index: distrib/common/elfrdsetroot.c ================================================== ================= RCS file: /home/chl/mirrors/cvs.obsd.org/src/distrib/common/elfrdsetroot.c,v retrieving revision 1.10 diff -u -r1.10 elfrdsetroot.c --- distrib/common/elfrdsetroot.c 14 Jan 2005 22:47:06 -0000 1.10 +++ distrib/common/elfrdsetroot.c 10 Oct 2006 21:26:29 -0000 @@ -116,7 +116,7 @@ phsize = eh.e_phnum * sizeof(Elf_Phdr); ph = (Elf_Phdr *)malloc(phsize); - lseek(fd, eh.e_phoff, 0); + lseek(fd, eh.e_phoff, SEEK_SET); if (read(fd, (char *)ph, phsize) != phsize) { printf("%s: can't read phdr area\n", file); exit(1); Index: games/hack/hack.save.c ================================================== ================= RCS file: /home/chl/mirrors/cvs.obsd.org/src/games/hack/hack.save.c,v retrieving revision 1.7 diff -u -r1.7 hack.save.c --- games/hack/hack.save.c 19 May 2003 09:00:54 -0000 1.7 +++ games/hack/hack.save.c 10 Oct 2006 21:26:29 -0000 @@ -201,7 +201,7 @@ savelev(nfd,tmp); (void) close(nfd); } - (void) lseek(fd, (off_t)0, 0); + (void) lseek(fd, (off_t)0, SEEK_SET); getlev(fd, 0, 0); (void) close(fd); (void) unlink(SAVEF); Index: sys/lib/libsa/readdir.c ================================================== ================= RCS file: /home/chl/mirrors/cvs.obsd.org/src/sys/lib/libsa/readdir.c,v retrieving revision 1.7 diff -u -r1.7 readdir.c --- sys/lib/libsa/readdir.c 11 Aug 2003 06:23:09 -0000 1.7 +++ sys/lib/libsa/readdir.c 10 Oct 2006 21:26:29 -0000 @@ -57,7 +57,7 @@ olseek(fd, 0, 0); #else if ((fd = open(name, O_RDONLY)) >= 0) - lseek(fd, 0, 0); + lseek(fd, 0, SEEK_SET); #endif return fd; Index: usr.sbin/lpr/lpr/lpr.c ================================================== ================= RCS file: /home/chl/mirrors/cvs.obsd.org/src/usr.sbin/lpr/lpr/lpr.c,v retrieving revision 1.38 diff -u -r1.38 lpr.c --- usr.sbin/lpr/lpr/lpr.c 12 Nov 2005 00:54:15 -0000 1.38 +++ usr.sbin/lpr/lpr/lpr.c 10 Oct 2006 21:26:29 -0000 @@ -379,7 +379,7 @@ char c; if (read(tfd, &c, 1) == 1 && - lseek(tfd, (off_t)0, 0) == 0 && + lseek(tfd, (off_t)0, SEEK_SET) == 0 && write(tfd, &c, 1) != 1) { warn("%s", tfname); tfname[inchar]++; @@ -701,7 +701,7 @@ } while (stat(tfname, &stb) == 0 || stat(cfname, &stb) == 0 || stat(dfname, &stb) == 0); inchar = strlen(SD) + 3; - (void)lseek(fd, (off_t)0, 0); + (void)lseek(fd, (off_t)0, SEEK_SET); snprintf(buf, sizeof(buf), "%03d\n", n); (void)write(fd, buf, strlen(buf)); (void)close(fd); /* unlocks as well */ Index: usr.sbin/mopd/common/loop-bsd.c ================================================== ================= RCS file: /home/chl/mirrors/cvs.obsd.org/src/usr.sbin/mopd/common/loop-bsd.c,v retrieving revision 1.11 diff -u -r1.11 loop-bsd.c --- usr.sbin/mopd/common/loop-bsd.c 17 Apr 2006 16:23:01 -0000 1.11 +++ usr.sbin/mopd/common/loop-bsd.c 10 Oct 2006 21:26:30 -0000 @@ -142,7 +142,7 @@ if (cc < 0) { if (errno == EINVAL && (lseek(ii->fd, 0, SEEK_CUR) + bufsize) < 0) { - lseek(ii->fd, 0, 0); + lseek(ii->fd, 0, SEEK_SET); goto again; } syslog(LOG_ERR, "read: %m"); |