summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjaromil <jaromil@129b00e9-8bf7-0310-bee9-bd51b64996e4>2007-11-25 10:28:55 (GMT)
committer jaromil <jaromil@129b00e9-8bf7-0310-bee9-bd51b64996e4>2007-11-25 10:28:55 (GMT)
commit2ae4b7feb7fbc5a2e1eb0ddf861e4e48f9ed1439 (patch)
tree4f4ce8f4dfcb6d0fd7a88de0baf8ffc4676ee7f0
parent9c12e220aef03f9840d4f69ffe37fae409119cfd (diff)
nesting: upgrades in the last 2.4 and 2.5 versions
git-svn-id: svn://dyne.org/dynebolic@260 129b00e9-8bf7-0310-bee9-bd51b64996e4
-rw-r--r--dyneII/taschino2/parts.cpp32
1 files changed, 12 insertions, 20 deletions
diff --git a/dyneII/taschino2/parts.cpp b/dyneII/taschino2/parts.cpp
index 53958f2..0f3b6bc 100644
--- a/dyneII/taschino2/parts.cpp
+++ b/dyneII/taschino2/parts.cpp
@@ -63,19 +63,11 @@ void analyze(int num) {
check if the partition is writable
check if the partition has some space
check if the partition has allready a config */
- snprintf(tmp,512,"%s/dynebol.nst",parts[num].path);
+ snprintf(tmp,512,"%s/dyne/dyne.nst",parts[num].path);
tmpfd = open(tmp,O_RDONLY);
if(tmpfd>0) {
close(tmpfd);
parts[num].has_nest = true;;
- } else {
- /* check also the new nest path */
- snprintf(tmp,512,"%s/dyne/dynebol.nst",parts[num].path);
- tmpfd = open(tmp,O_RDONLY);
- if(tmpfd>0) {
- close(tmpfd);
- parts[num].has_nest = true;
- }
}
snprintf(tmp,512,"%s/.dyne_test_writable",parts[num].path);
tmpfd = open(tmp,O_CREAT|O_EXCL,S_IRWXU);
@@ -197,19 +189,19 @@ int scan_parts() {
} // for cycle thru partitions found by scandir
} // for cycle thru harddisks
- usbfound = chdir("/mnt/usb");
- if(usbfound<0) perror("can't scan /mnt/usb");
- else {
- sync();
- c++;
- snprintf(parts[c].path,255,"/mnt/usb");
- parts[c].num = c;
- parts[c].support = USB;
-
- analyze(c);
+ /* scan for usb hotplugged storage */
+ usbfound = scandir("/mnt", &hdlist, usb_selector, alphasort);
+ if(usbfound<0) perror("can't scan /mnt");
+
+ for(c=0;c<usbfound;c++) {
+ snprintf(parts[parts_found].path,255,"/mnt/%s",hdlist[c]->d_name);
+ parts[parts_found].num = parts_found;
+ parts[parts_found].support = USB;
+ analyze(parts_found);
+
parts_found++;
- }
+ } // to cycle thru partitions found by scandir
scanned = true;
return parts_found;