Changeset a08bfc3 for zcrypt.c


Ignore:
Timestamp:
Mar 17, 2010, 10:36:59 PM (14 years ago)
Author:
Nelson Elhage <nelhage@ksplice.com>
Branches:
master, release-1.10, release-1.6, release-1.7, release-1.8, release-1.9
Children:
4133e34
Parents:
356465e
git-author:
Nelson Elhage <nelhage@mit.edu> (04/13/09 20:35:44)
git-committer:
Nelson Elhage <nelhage@ksplice.com> (03/17/10 22:36:59)
Message:
zcrypt: Send errors to stderr, not stdout.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zcrypt.c

    r356465e ra08bfc3  
    190190    if (!zoptions.message)
    191191    {
    192       printf("Memory allocation error.\n");
     192      fprintf(stderr, "Memory allocation error.\n");
    193193      error = TRUE;
    194194    }
     
    210210  if (error || fname == NULL)
    211211  {
    212     printf("Usage: %s [-Z|-D|-E|-R|-S] [-F Keyfile] [-c class] [-i instance]\n", argv[0]);
    213     printf("       [-advqtluon] [-s signature] [-f arg] [-m message]\n");
    214     printf("  One or more of class, instance, and keyfile must be specified.\n");
     212    fprintf(stderr, "Usage: %s [-Z|-D|-E|-R|-S] [-F Keyfile] [-c class] [-i instance]\n", argv[0]);
     213    fprintf(stderr, "       [-advqtluon] [-s signature] [-f arg] [-m message]\n");
     214    fprintf(stderr, "  One or more of class, instance, and keyfile must be specified.\n");
    215215  }
    216216  else
     
    230230        }
    231231 */
    232       printf("Feature not yet implemented.\n");
     232      fprintf(stderr, "Feature not yet implemented.\n");
    233233    }
    234234    else if (mode == M_SETKEY)
     
    250250      fkey = fopen(fname, "w");
    251251      if (!fkey)
    252         printf("Could not open key file for writing: %s\n", fname);
     252        fprintf(stderr, "Could not open key file for writing: %s\n", fname);
    253253      else
    254254      {
    255255        if (fputs(newkey, fkey) != strlen(newkey) || putc('\n', fkey) != '\n')
    256256        {
    257           printf("Error writing to key file.\n");
     257          fprintf(stderr, "Error writing to key file.\n");
    258258          fclose(fkey);
    259259        }
     
    261261        {
    262262          fclose(fkey);
    263           printf("Key update complete.\n");
     263          fprintf(stderr, "Key update complete.\n");
    264264        }
    265265      }
     
    270270      FILE *fkey = fopen(fname, "r");
    271271      if (!fkey)
    272         printf("Could not open key file: %s\n", fname);
     272        fprintf(stderr, "Could not open key file: %s\n", fname);
    273273      else
    274274      {
     
    394394    if (keyfile == NULL)
    395395    {
    396       printf("Could not find key table entry.\n");
     396      fprintf(stderr, "Could not find key table entry.\n");
    397397    }
    398398    else
     
    404404        strcpy(keyfile, temp);
    405405      else
    406         printf("Memory allocation error.\n");
     406        fprintf(stderr, "Memory allocation error.\n");
    407407    }
    408408   
     
    410410  }
    411411  else
    412     printf("Could not open key table file: %s\n", filename);
     412    fprintf(stderr, "Could not open key table file: %s\n", filename);
    413413
    414414  for(i = 0; i < MAX_SEARCH; i++) {
     
    485485    close(fildes[0]);
    486486    execvp(argv[0], argv);
    487     printf("Exec error: could not run zwrite\n");
     487    fprintf(stderr, "Exec error: could not run zwrite\n");
    488488    exit(0);
    489489  }
     
    564564      if ((inptr = inbuff = (char *)malloc(MAX_RESULT)) == NULL)
    565565      {
    566         printf("Memory allocation error\n");
     566        fprintf(stderr, "Memory allocation error\n");
    567567        return FALSE;
    568568      }
     
    594594    if (!outfile)
    595595    {
    596       printf("Could not run zwrite\n");
     596      fprintf(stderr, "Could not run zwrite\n");
    597597      if (freein && inbuff)
    598598        free(inbuff);
Note: See TracChangeset for help on using the changeset viewer.