]> mj.ucw.cz Git - libucw.git/commitdiff
Shared file handles now use is_temp_file == 2 instead of -1
authorMartin Mares <mj@ucw.cz>
Sat, 25 Aug 2007 14:19:01 +0000 (16:19 +0200)
committerMartin Mares <mj@ucw.cz>
Sat, 25 Aug 2007 14:19:01 +0000 (16:19 +0200)
to avoid collisions with negative return values of bconfig()
meaning "not supported".

lib/fastbuf.h
lib/fb-param.c

index c763f243ac0dbf283280322576c1b0a8349694f6..920d83ebd2a3728e0d215dfeaf85a0dacf0a86ef 100644 (file)
@@ -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 */
 };
 
index bbe9e3409579b10bd3c295934993ab87ea1aabda..11cd258ce285eab0c54f91fa74cf4177f8248a2e 100644 (file)
@@ -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;
 }