Permalink
Browse files

`make distcheck` release cleanup. fixed a couple of bugs:

  - check the return value from truncate()
  - open() w/ O_CREAT must provide the file mode
    - this needs work as I'm just forcing S_I{R,W}USR here
  • Loading branch information...
benlemasurier committed Jan 12, 2012
1 parent 4281be6 commit ed3994300b983e99ac1c112af4ab46b6ee7fa9c8
Showing with 14 additions and 4 deletions.
  1. +1 −0 .gitignore
  2. +8 −0 Makefile.am
  3. +1 −1 autogen.sh
  4. +1 −1 src/Makefile.am
  5. +3 −2 src/stormfs.c
View
@@ -2,6 +2,7 @@
*.swp
*.swo
*.dSYM
+*.tar.gz
.DS_Store
autom4te.cache
aclocal.m4
View
@@ -1 +1,9 @@
SUBDIRS = src
+
+# additional flags to be passed to aclocal when invoked at make time.
+ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
+
+dist_noinst_SCRIPTS = autogen.sh
+
+dist-hook:
+ rm -rf `find $(distdir)/doc -type d -name .svn`
View
@@ -1,6 +1,6 @@
#!/bin/sh
-autoreconf --force --install
+autoreconf --force --install --verbose
if [ -d /usr/local/share/aclocal ]
then
aclocal -I /usr/local/share/aclocal
View
@@ -1,6 +1,6 @@
bin_PROGRAMS = stormfs
-stormfs_SOURCES = curl.c stormfs.c
+stormfs_SOURCES = curl.h curl.c stormfs.h stormfs.c
stormfs_LDADD = $(LIBS) $(LIBGCRYPT_LIBS)
stormfs_CFLAGS = -D_REENTRANT -DFUSE_USE_VERSION=26 -D_FILE_OFFSET_BITS=64 $(STORMFS_CFLAGS)
stormfs_LDFLAGS = $(STORMFS_LIBS)
View
@@ -270,7 +270,7 @@ cache_create_file(struct file *f)
unlink(cp);
- result = open(cp, O_CREAT | O_TRUNC | O_RDWR);
+ result = open(cp, O_CREAT | O_TRUNC | O_RDWR, S_IRUSR | S_IWUSR);
if(result == -1)
perror("open");
@@ -778,7 +778,8 @@ stormfs_truncate(const char *path, off_t size)
f = cache_get(path);
if(cache_file_valid(f)) {
char *cp = cache_path(f);
- truncate(cp, size);
+ if((result = truncate(cp, size)) != 0)
+ perror("truncate");
free(cp);
} else {
fd = cache_create_file(f);

0 comments on commit ed39943

Please sign in to comment.