~ubuntu-branches/ubuntu/hardy/sg3-utils/hardy

« back to all changes in this revision

Viewing changes to sg_scan.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2006-09-19 21:00:55 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060919210055-j9deachd976os9my
Tags: 1.21-1ubuntu1
* Sync with Debian
* debian/control:
  + Let the -dev package depend on the runtime package
* llseek.c:
  + Fix syntax errors. Patch taken from Gentoo:
    http://mir2.ovh.net/gentoo-portage/sys-apps/sg3_utils/files/sg3_utils-llseek.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
   F. Jansen - modification to extend beyond 26 sg devices.
43
43
*/
44
44
 
45
 
static char * version_str = "4.07 20060324";
 
45
static char * version_str = "4.08 20060623";
46
46
 
47
47
#define ME "sg_scan: "
48
48
 
189
189
        memset(gen_index_arr, 0, max_file_args * sizeof(int));
190
190
    else {
191
191
        printf(ME "Out of memory\n");
192
 
        return 1;
 
192
        return SG_LIB_CAT_OTHER;
193
193
    }
194
194
 
195
195
    for (k = 1, j = 0; k < argc; ++k) {
208
208
                    printf("Scan sg device names and optionally do an "
209
209
                           "INQUIRY\n\n");
210
210
                    usage();
211
 
                    return 1;
 
211
                    return 0;
212
212
                case 'i':
213
213
                    do_inquiry = 1;
214
214
                    break;
239
239
            if (jmp_out) {
240
240
                fprintf(stderr, "Unrecognized option: %s\n", cp);
241
241
                usage();
242
 
                return 1;
 
242
                return SG_LIB_SYNTAX_ERROR;
243
243
            }
244
244
        } else {
245
245
            if (j < max_file_args) {
247
247
                gen_index_arr[j++] = k;
248
248
            } else {
249
249
                printf("Too many command line arguments\n");
250
 
                return 1;
 
250
                return SG_LIB_SYNTAX_ERROR;
251
251
            }
252
252
        }
253
253
    }
264
264
        if (res < 0) {
265
265
            snprintf(ebuff, EBUFF_SZ, ME "Error closing %s ", fname);
266
266
            perror(ebuff);
267
 
            return 1;
 
267
            return SG_LIB_FILE_ERROR;
268
268
        }
269
269
        if (has_file_args) {
270
270
            if (gen_index_arr[j])