summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Lilleengen <lulf@pvv.ntnu.no>2008-08-18 12:33:02 +0200
committerUlf Lilleengen <lulf@pvv.ntnu.no>2008-08-18 12:33:02 +0200
commit83eba401bb87038effa4012d2949c6d4a006559e (patch)
treef9a432a65053edde86a8feadbb83961dadad3238
parent4c8abbb856eba5b5ce81b7f32c45a47ae89eb719 (diff)
Revert "- Add comment to bug."
This reverts commit c2289bd5e2bdb03230d75b7a05a3f053c1bafe6e.
-rw-r--r--TODO5
-rw-r--r--src/mfs_subr.c2
-rwxr-xr-xsrc/mfs_vnops.c15
3 files changed, 11 insertions, 11 deletions
diff --git a/TODO b/TODO
index d1a4de5..b1bde44 100644
--- a/TODO
+++ b/TODO
@@ -5,10 +5,13 @@ v. 0.1
* Better interface (the new .config is pretty good, but needs
improvement)
-* BUG: musicfs only works in debug mode. Why? Fix this!
+* BUG: musicfs only works in debug mode.
* -f (foreground mode) also works
* -s (single thread) does not
+ Update: This works if I disable DEBUGGING, probably because of some permission
+ problems when using file I/O in not debugging mode.
+
* BUG: what to do with songs without tags? The current behavior,
breaking badly, is probably not what we want. Suggestions:
* We put all songs not having complete tags in an Unsorted folder, with the
diff --git a/src/mfs_subr.c b/src/mfs_subr.c
index b83c75d..420046b 100644
--- a/src/mfs_subr.c
+++ b/src/mfs_subr.c
@@ -62,6 +62,8 @@ char *mfs_get_home_path(const char *extra)
char *res;
const char *home = getenv("HOME");
+ if (home == NULL)
+ return (NULL);
hlen = strlen(home);
exlen = (extra != NULL) ? strlen(extra) : 0;
diff --git a/src/mfs_vnops.c b/src/mfs_vnops.c
index 9af8a2f..da23177 100755
--- a/src/mfs_vnops.c
+++ b/src/mfs_vnops.c
@@ -42,6 +42,7 @@
static int mfs_getattr (const char *path, struct stat *stbuf)
{
char *realpath;
+ int res;
int status = 0;
memset (stbuf, 0, sizeof (struct stat));
@@ -56,7 +57,7 @@ static int mfs_getattr (const char *path, struct stat *stbuf)
char *mfsrc = mfs_get_home_path(".mfsrc");
if (mfsrc == NULL)
return (-ENOMEM);
- int res = stat(mfsrc, stbuf);
+ res = stat(mfsrc, stbuf);
DEBUG("stat result for %s: %d\n", mfsrc, res);
free(mfsrc);
return (res);
@@ -75,17 +76,11 @@ static int mfs_getattr (const char *path, struct stat *stbuf)
status = mfs_realpath(path, &realpath);
if (status != 0)
return status;
- if (stat(realpath, stbuf) != 0) {
- free(realpath);
- return -ENOENT;
- }
+ res = stat(realpath, stbuf);
free(realpath);
- return 0;
-
- case MFS_NOTFOUND:
- default:
- return -ENOENT;
+ return (res);
}
+ return (-ENOENT);
}