version 1.4, 2000/06/19 20:35:47 |
version 1.5, 2000/06/19 22:42:28 |
|
|
"ioctl error while getting key counter." |
"ioctl error while getting key counter." |
}; |
}; |
|
|
void tcfs_error (int error_type, char *custom_message) |
void tcfs_error(int error_type, char *custom_message) |
{ |
{ |
if (error_type!=ER_CUSTOM && error_type!=OK) |
if (error_type != ER_CUSTOM && error_type != OK) |
fprintf (stderr, "Error: "); |
fprintf(stderr, "Error: "); |
|
|
switch (error_type) |
switch (error_type) { |
{ |
case ER_AUTH: |
case ER_AUTH: |
case ER_MEM: |
case ER_MEM: |
case ER_TCFS: |
case ER_TCFS: |
case ER_PERM: |
case ER_PERM: |
case ER_ENABLE: |
case ER_ENABLE: |
case ER_DISABLE: |
case ER_DISABLE: |
case ER_COUNT: |
case ER_COUNT: |
case ER_USER: |
case ER_USER: |
case OK: |
case OK: |
fprintf(stderr, "%s\n", tcfs_errors_strings[error_type]); |
fprintf (stderr, "%s\n", tcfs_errors_strings[error_type]); |
exit(error_type); |
exit (error_type); |
case ER_CUSTOM: |
case ER_CUSTOM: |
fprintf(stderr, "%s\n", custom_message); |
fprintf (stderr, "%s\n", custom_message); |
exit(1); |
exit (1); |
case ER_UNKOPT: |
case ER_UNKOPT: |
if (custom_message) |
if (custom_message) |
fprintf(stderr, "%s: %s\n", tcfs_errors_strings[error_type], custom_message); |
fprintf (stderr, "%s: %s\n", tcfs_errors_strings[error_type], custom_message); |
else |
else |
fprintf(stderr, "%s\n", tcfs_errors_strings[error_type]); |
fprintf (stderr, "%s\n", tcfs_errors_strings[error_type]); |
|
|
|
exit (error_type); |
exit(error_type); |
break; /* Useless code */ |
break; /* Useless code */ |
default: |
default: |
fprintf (stderr, "internal error.\n"); |
fprintf(stderr, "internal error.\n"); |
exit (1); |
exit(1); |
} |
} |
} |
} |
|
|
void show_usage (char *fmt, char *arg) |
void show_usage(char *fmt, char *arg) |
{ |
{ |
printf (fmt, arg); |
printf(fmt, arg); |
} |
} |