ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Damir Shayhutdinov" <damir@altlinux.org>
To: "ALT Devel discussion list" <devel@lists.altlinux.org>
Subject: Re: [devel] volatile void для ф-ции
Date: Sat, 9 Sep 2006 16:25:35 +0400
Message-ID: <679044850609090525o7038d70fp898f7a5359ea7b2c@mail.gmail.com> (raw)
In-Reply-To: <auto-000306281618@intranet.ru>

>     Также попутно возник вопрос чисто программерский: имеет ли смысл
>     определять ф-ции наподобие приведённых здесь die() и fatal(), чтобы
>     потом везде не писать perror(); exit() и fprintf(); exit() ? Есть ли
>     какие-нибудь минусы в таком подходе?
Ну то что это фактически err(3) и warn(3), а значит, переизобретенный велосипед.

ИМХО, если в программе много раз используется exit (и его аналоги типа
err/errx), это просто замаскированная проблема с анализом возвращаемых
значений.

Как правило, такой код невозможно повторно использовать во всяких
демонах, которые должны выживать в ситуациях и похуже, чем
невозможность открытия определенного файла (или для чего там обычно
используется err/exit).

  reply	other threads:[~2006-09-09 12:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-09 11:51 Slava Semushin
2006-09-09 12:25 ` Damir Shayhutdinov [this message]
2006-09-14  0:21 ` Serge Pavlovsky
2006-09-14  0:37 ` Serge Pavlovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=679044850609090525o7038d70fp898f7a5359ea7b2c@mail.gmail.com \
    --to=damir@altlinux.org \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git