From: Martin Mares Date: Sat, 25 Aug 2007 14:19:01 +0000 (+0200) Subject: Shared file handles now use is_temp_file == 2 instead of -1 X-Git-Tag: holmes-import~506^2~13^2~82 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=91d17c7ed0cebbf992028b704e5ee4f14cce57ad;p=libucw.git Shared file handles now use is_temp_file == 2 instead of -1 to avoid collisions with negative return values of bconfig() meaning "not supported". --- diff --git a/lib/fastbuf.h b/lib/fastbuf.h index c763f243..920d83eb 100644 --- a/lib/fastbuf.h +++ b/lib/fastbuf.h @@ -187,7 +187,7 @@ fbatomic_commit(struct fastbuf *b) /* Configuring stream parameters */ enum bconfig_type { - BCONFIG_IS_TEMP_FILE, /* 0=normal file, 1=temporary file, -1=shared fd */ + BCONFIG_IS_TEMP_FILE, /* 0=normal file, 1=temporary file, 2=shared fd */ BCONFIG_KEEP_BACK_BUF, /* Optimize for bi-directional access */ }; diff --git a/lib/fb-param.c b/lib/fb-param.c index bbe9e340..11cd258c 100644 --- a/lib/fb-param.c +++ b/lib/fb-param.c @@ -164,7 +164,7 @@ struct fastbuf * bfdopen_shared(int fd, uns buflen) { struct fastbuf *f = bfdopen(fd, buflen); - bconfig(f, BCONFIG_IS_TEMP_FILE, -1); + bconfig(f, BCONFIG_IS_TEMP_FILE, 2); return f; }