diff --git a/src/plugins/volumes.c b/src/plugins/volumes.c index 9a921d1..5be4851 100644 --- a/src/plugins/volumes.c +++ b/src/plugins/volumes.c @@ -18,7 +18,11 @@ #include #include #include -#ifdef __NetBSD__ +#if defined(__FreeBSD__) +# include +# include +# include +#elif defined(__NetBSD__) # include # include #endif @@ -170,10 +174,14 @@ static void _refresh_add(Volumes * volumes, char const * name, static void _volumes_refresh(Volumes * volumes, GList * selection) { char * path = (selection != NULL) ? selection->data : NULL; -#ifdef __NetBSD__ +#if defined(ST_NOWAIT) struct statvfs * mnt; int res; int i; +#elif defined(MNT_NOWAIT) + struct statfs * mnt; + int res; + int i; #endif #ifdef DEBUG @@ -188,8 +196,15 @@ static void _volumes_refresh(Volumes * volumes, GList * selection) } /* FIXME no longer clear the list every time */ gtk_list_store_clear(volumes->store); -#ifdef __NetBSD__ - if((res = getmntinfo(&mnt, ST_WAIT)) <= 0) +#if defined(ST_NOWAIT) + if((res = getmntinfo(&mnt, ST_NOWAIT)) <= 0) + return; + for(i = 0; i < res; i++) + _refresh_add(volumes, NULL, mnt[i].f_mntfromname, + mnt[i].f_mntonname, mnt[i].f_fstypename, + mnt[i].f_bavail, mnt[i].f_blocks); +#elif defined(MNT_NOWAIT) + if((res = getmntinfo(&mnt, MNT_NOWAIT)) <= 0) return; for(i = 0; i < res; i++) _refresh_add(volumes, NULL, mnt[i].f_mntfromname,