Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37047751
en ru br
Репозитории ALT
S:2.1.5-alt4
5.1: 2.1.5-alt3
4.1: 2.1.5-alt3
4.0: 2.1.5-alt3
3.0: 2.1.0-alt1
www.altlinux.org/Changes

Другие репозитории
Upstream:2.1.5

Группа :: Система/Ядро и оборудование
Пакет: eject

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: eject-2.1.5-alt-usage-stdout.patch
Скачать


--- eject/eject.c~	2007-06-28 19:39:46 +0400
+++ eject/eject.c	2007-06-28 19:43:59 +0400
@@ -151,10 +151,10 @@ static const char *partitionDevice[] = {
 
 
 /* Display command usage on standard error and exit. */
-static void usage()
+static void usage(FILE *stream)
 {
 //    perror(_("%s: device is `%s'\n"));
-	fprintf(stderr,_(
+	fprintf(stream,_(
 "Eject version %s by Jeff Tranter (tranter@pobox.com)\n"
 "Usage:\n"
 "  eject -h				-- display command usage and exit\n"
@@ -185,7 +185,7 @@ static void usage()
 )
 , version);
 #ifdef GETOPTLONG
-	fprintf(stderr,_(
+	fprintf(stream,_(
 "Long options:\n"
 "  -h --help   -v --verbose      -d --default\n"
 "  -a --auto   -c --changerslot  -t --trayclose  -x --cdspeed\n"
@@ -209,7 +209,6 @@ static void usage()
 "If omitted, name defaults to `%s'.\n"
 "By default tries -r, -s, -f, and -q in order until success.\n"),
 			DEFAULTDEVICE);
-  exit(1);
 }
 
 
@@ -296,7 +295,7 @@ static void parse_args(int argc, char **
 			  f_option = 1;
 			  break;
 		  case 'h':
-			  usage();
+			  usage(stdout);
 			  exit(0);
 			  break;
 		  case 'm':
@@ -334,6 +333,7 @@ static void parse_args(int argc, char **
 			  exit(0);
 			  break;
 		  case '?':
+			  usage(stderr);
 			  exit(1);
 			  break;
 		}
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin