ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] Q: runbg
@ 2001-01-04 19:44 Dmitry V. Levin
  0 siblings, 0 replies; only message in thread
From: Dmitry V. Levin @ 2001-01-04 19:44 UTC (permalink / raw)
  To: devel


[-- Attachment #1.1: Type: text/plain, Size: 535 bytes --]

Greetings!

Никто не имеет ничего против помещения утилиты runbg в пакет sh-utils?


Regards,
	Dmitry

+-------------------------------------------------------------------------+
Dmitry V. Levin     mailto://ldv@fandra.org
Software Engineer   PGP pubkey http://www.fandra.org/users/ldv/pgpkeys.html
IPLabs Linux Team   http://linux.iplabs.ru
Fandra Project      http://www.fandra.org
+-------------------------------------------------------------------------+
UNIX is user friendly. It's just very selective about who its friends are.

[-- Attachment #1.2: runbg.c --]
[-- Type: text/plain, Size: 614 bytes --]

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <error.h>

extern const char *__progname;

void	my_error_print_progname( void )
{
	fprintf( stderr, "%s: ", __progname );
}

int	main( int ac, char *const *av )
{
	error_print_progname = my_error_print_progname;

	if ( ac < 2 )
		error( 1, 0, "usage: %s program [arguments]", __progname );
	else
	{
		int pid = fork();
		if ( pid < 0 )
			error( 1, errno, "fork" );
		else if ( pid )
			return 0;
		if ( setsid() < 0 )
			error( 1, errno, "setsid" );
		execvp( av[1], av+1 );
		error( 1, errno, "%s", av[1] );
	}

	return 0;
}

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-01-04 19:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-04 19:44 [devel] Q: runbg Dmitry V. Levin

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