- dbprintf(("%s: version %s\n", pgm, version()));
-#ifdef DEBUG_CODE
- if(dbfd() != -1 && dbfd() != STDERR_FILENO)
- {
- if(dup2(dbfd(),STDERR_FILENO) != STDERR_FILENO)
- {
- perror("amidxtaped can't redirect stderr to the debug file");
- dbprintf(("%s: can't redirect stderr to the debug file\n",
- debug_prefix_time(NULL)));
- return 1;
- }
- }
-#else
- if ((i = open("/dev/null", O_WRONLY)) == -1 ||
- (i != STDERR_FILENO &&
- (dup2(i, STDERR_FILENO) != STDERR_FILENO ||
- close(i) != 0))) {
- perror("amidxtaped can't redirect stderr");
- return 1;
- }
-#endif
+ dbprintf(_("%s: version %s\n"), pgm, version());
+ debug_dup_stderr_to_debug();