Ignore:
Timestamp:
Aug 18, 2009, 3:33:19 PM (11 years ago)
Author:
Bruno Cornec
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/common/libmondo-stream.c

    r2331 r2332  
    246246 * @return the allocated tape string if success, NULL if failure
    247247 */
    248 char *mr_find_tape_device(void)
    249 {
     248char *mr_find_tape_device(void) {
     249
    250250    char *tmp = NULL;
    251251    char *command = NULL;
     
    256256
    257257    log_to_screen("I am looking for your tape streamer. Please wait.");
     258
    258259    tmp = find_home_of_exe("cdrecord");
    259260    if (tmp) {
    260261        mr_asprintf(cdr_exe, "cdrecord");
     262
    261263    } else {
    262264        mr_asprintf(cdr_exe, "dvdrecord");
     
    270272    if (atoi(tmp) != 1) {
    271273        log_it("Either too few or too many tape streamers for me to detect...");
    272         mr_asprintf(&dev, "%s", VANILLA_SCSI_TAPE);
     274        mr_asprintf(dev, "%s", VANILLA_SCSI_TAPE);
    273275        mr_free(tmp);
    274276        mr_free(tmp);
     
    290292    mr_asprintf(command, "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f3 | cut -d')' -f1 | head -n1", cdr_exe);
    291293    mr_free(cdr_exe);
    292 
    293294    mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));
    294295    mr_free(command);
     
    301302    if (!mt_says_tape_exists(dev)) {
    302303        mr_free(dev);
    303         mr_asprintf(&dev, "%s", ALT_TAPE);
     304        mr_asprintf(dev, "%s", ALT_TAPE);
    304305        if (!mt_says_tape_exists(dev)) {
    305306            log_it("Cannot openin %s", dev);
    306307            mr_free(dev);
    307             mr_asprintf(&dev, "/dev/st0");
     308            mr_asprintf(dev, "/dev/st0");
    308309            if (!mt_says_tape_exists(dev)) {
    309310                log_it("Cannot openin %s", dev);
    310311                mr_free(dev);
    311                 mr_asprintf(&dev, "/dev/osst0");
     312                mr_asprintf(dev, "/dev/osst0");
    312313                if (!mt_says_tape_exists(dev)) {
    313314                    mr_free(dev);
     
    335336        mr_asprintf(tmp, "%s", (strrchr(dev, '/') != NULL) ? strrchr(dev, '/') : dev);
    336337        mr_free(dev);
    337         mr_asprintf(&dev, "/dev/os%s", tmp);
     338        mr_asprintf(dev, "/dev/os%s", tmp);
    338339        log_it("...into %s", dev);
    339340        if (mt_says_tape_exists(dev)) {
     
    345346    }
    346347
    347     log_it("res=%d; dev=%s", res, dev);
    348 
    349348    if (dev) {
    350349        log_it("At this new point, dev = %s and res = %d", dev, res);
    351350    } else {
    352         log_it("At this new point, dev is NULL and res = %d", dev, res);
     351        log_it("At this new point, dev is NULL and res = %d", res);
    353352        mr_free(tmp);
    354         return(NULL);
    355353    }
    356354
Note: See TracChangeset for help on using the changeset viewer.