From 2954746ef5c897ec5e651cc2c39eda878f1d5da5 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 4 Sep 1997 13:57:39 +0000 Subject: [PATCH] Added O_BINARY for open calls. --- index/kinput.c | 7 +++++-- index/lockidx.c | 15 ++++++++++----- index/locksrv.c | 11 +++++++---- rset/rstemp.c | 11 +++++++---- 4 files changed, 29 insertions(+), 15 deletions(-) diff --git a/index/kinput.c b/index/kinput.c index d356783..eb7b251 100644 --- a/index/kinput.c +++ b/index/kinput.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: kinput.c,v $ - * Revision 1.22 1997-02-12 20:39:45 adam + * Revision 1.23 1997-09-04 13:57:39 adam + * Added O_BINARY for open calls. + * + * Revision 1.22 1997/02/12 20:39:45 adam * Implemented options -f that limits the log to the first * records. * Changed some log messages also. @@ -133,7 +136,7 @@ void key_file_chunk_read (struct key_file *f) int nr = 0, r, fd; char fname[1024]; getFnameTmp (fname, f->no); - fd = open (fname, O_RDONLY); + fd = open (fname, O_BINARY|O_RDONLY); if (fd == -1) { logf (LOG_FATAL|LOG_ERRNO, "cannot open %s", fname); diff --git a/index/lockidx.c b/index/lockidx.c index 286bd41..1a0262c 100644 --- a/index/lockidx.c +++ b/index/lockidx.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: lockidx.c,v $ - * Revision 1.8 1997-02-12 20:39:46 adam + * Revision 1.9 1997-09-04 13:58:04 adam + * Added O_BINARY for open calls. + * + * Revision 1.8 1997/02/12 20:39:46 adam * Implemented options -f that limits the log to the first * records. * Changed some log messages also. @@ -61,7 +64,8 @@ int zebraIndexWait (int commitPhase) if (server_lock_cmt == -1) { sprintf (path, "%s%s", pathPrefix, FNAME_COMMIT_LOCK); - if ((server_lock_cmt = open (path, O_CREAT|O_RDWR|O_SYNC, 0666)) + if ((server_lock_cmt = open (path, O_BINARY|O_CREAT|O_RDWR|O_SYNC, + 0666)) == -1) { logf (LOG_FATAL|LOG_ERRNO, "create %s", path); @@ -73,7 +77,8 @@ int zebraIndexWait (int commitPhase) if (server_lock_org == -1) { sprintf (path, "%s%s", pathPrefix, FNAME_ORG_LOCK); - if ((server_lock_org = open (path, O_CREAT|O_RDWR|O_SYNC, 0666)) + if ((server_lock_org = open (path, O_BINARY|O_CREAT|O_RDWR|O_SYNC, + 0666)) == -1) { logf (LOG_FATAL|LOG_ERRNO, "create %s", path); @@ -152,10 +157,10 @@ void zebraIndexLock (int commitNow) sprintf (path, "%s%s", pathPrefix, FNAME_MAIN_LOCK); while (1) { - lock_fd = open (path, O_CREAT|O_RDWR|O_EXCL, 0666); + lock_fd = open (path, O_BINARY|O_CREAT|O_RDWR|O_EXCL, 0666); if (lock_fd == -1) { - lock_fd = open (path, O_RDWR); + lock_fd = open (path, O_BINARY|O_RDWR); if (lock_fd == -1) { if (errno == ENOENT) diff --git a/index/locksrv.c b/index/locksrv.c index f8d712d..5ea2c92 100644 --- a/index/locksrv.c +++ b/index/locksrv.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: locksrv.c,v $ - * Revision 1.6 1996-10-29 14:06:52 adam + * Revision 1.7 1997-09-04 13:58:04 adam + * Added O_BINARY for open calls. + * + * Revision 1.6 1996/10/29 14:06:52 adam * Include zebrautl.h instead of alexutil.h. * * Revision 1.5 1996/05/15 11:58:18 adam @@ -50,7 +53,7 @@ int zebraServerLock (int commitPhase) if (server_lock_cmt == -1) { sprintf (path, "%s%s", pathPrefix, FNAME_COMMIT_LOCK); - if ((server_lock_cmt = open (path, O_CREAT|O_RDWR, 0666)) + if ((server_lock_cmt = open (path, O_BINARY|O_CREAT|O_RDWR, 0666)) == -1) { logf (LOG_FATAL|LOG_ERRNO, "create %s", path); @@ -59,7 +62,7 @@ int zebraServerLock (int commitPhase) assert (server_lock_org == -1); sprintf (path, "%s%s", pathPrefix, FNAME_ORG_LOCK); - if ((server_lock_org = open (path, O_CREAT|O_RDWR, 0666)) + if ((server_lock_org = open (path, O_BINARY|O_CREAT|O_RDWR, 0666)) == -1) { logf (LOG_FATAL|LOG_ERRNO, "create %s", path); @@ -112,7 +115,7 @@ int zebraServerLockGetState (time_t *timep) *timep = xstat.st_ctime; sprintf (path, "%s%s", pathPrefix, FNAME_MAIN_LOCK); - fd = open (path, O_RDONLY); + fd = open (path, O_BINARY|O_RDONLY); if (fd == -1) { *buf = 0; diff --git a/rset/rstemp.c b/rset/rstemp.c index c6a7dc9..8e3ff84 100644 --- a/rset/rstemp.c +++ b/rset/rstemp.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: rstemp.c,v $ - * Revision 1.18 1996-10-29 13:54:52 adam + * Revision 1.19 1997-09-04 13:58:57 adam + * Added O_BINARY for open calls. + * + * Revision 1.18 1996/10/29 13:54:52 adam * Changed name of setting tempSetDir to setTmpDir. * * Revision 1.17 1995/12/11 09:15:28 adam @@ -158,9 +161,9 @@ static RSFD r_open (RSET ct, int flag) if (info->fname) { if (flag & RSETF_WRITE) - info->fd = open (info->fname, O_RDWR|O_CREAT, 0666); + info->fd = open (info->fname, O_BINARY|O_RDWR|O_CREAT, 0666); else - info->fd = open (info->fname, O_RDONLY); + info->fd = open (info->fname, O_BINARY|O_RDONLY); if (info->fd == -1) { logf (LOG_FATAL|LOG_ERRNO, "open %s", info->fname); @@ -188,7 +191,7 @@ static void r_flush (RSFD rfd, int mk) strcpy (info->fname, s); logf (LOG_DEBUG, "creating tempfile %s", info->fname); - info->fd = open (info->fname, O_RDWR|O_CREAT, 0666); + info->fd = open (info->fname, O_BINARY|O_RDWR|O_CREAT, 0666); if (info->fd == -1) { logf (LOG_FATAL|LOG_ERRNO, "open %s", info->fname); -- 1.7.10.4