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