|
Lines 34-39
Link Here
|
| 34 |
#include <sys/stat.h> |
34 |
#include <sys/stat.h> |
| 35 |
#include <unistd.h> |
35 |
#include <unistd.h> |
| 36 |
#include <stdio.h> |
36 |
#include <stdio.h> |
|
|
37 |
#include <mntent.h> |
| 37 |
/*}}}*/ |
38 |
/*}}}*/ |
| 38 |
|
39 |
|
| 39 |
// IsMounted - Returns true if the mount point is mounted /*{{{*/ |
40 |
// IsMounted - Returns true if the mount point is mounted /*{{{*/ |
|
Lines 100-105
bool UnmountCdrom(string Path)
Link Here
|
| 100 |
} |
101 |
} |
| 101 |
else |
102 |
else |
| 102 |
{ |
103 |
{ |
|
|
104 |
FILE *f; |
| 105 |
if ((f = setmntent ("/proc/mounts", "r")) != NULL) |
| 106 |
{ |
| 107 |
struct mntent *mnt; |
| 108 |
while ((mnt = getmntent (f)) != NULL) |
| 109 |
if (strcmp (Path.c_str(), mnt->mnt_dir) == 0) |
| 110 |
if ((strcmp ("subfs", mnt->mnt_type) == 0) || (strcmp ("supermount", mnt->mnt_type) == 0)) |
| 111 |
_exit(0); |
| 112 |
endmntent (f); |
| 113 |
} |
| 114 |
|
| 103 |
const char *Args[10]; |
115 |
const char *Args[10]; |
| 104 |
Args[0] = "umount"; |
116 |
Args[0] = "umount"; |
| 105 |
Args[1] = Path.c_str(); |
117 |
Args[1] = Path.c_str(); |