New global function.

1999-12-22  Martin Baulig  <martin@home-of-linux.org>

	* lib/errors.c (glibtop_get_errno_l): New global function.

	* lib/lib.pl: For functions with a `retval' return type, set
	`server->glibtop_errno' to the error code on error or to zero
	on success.
This commit is contained in:
Martin Baulig
1999-12-22 11:50:47 +00:00
committed by Martin Baulig
parent d66768ac55
commit d86a386ad8
4 changed files with 25 additions and 0 deletions

View File

@@ -221,6 +221,14 @@ sub output {
$sysdeps_code .= sprintf ("\t%sglibtop_get_%s_s (server, buf%s);\n",
$prefix, $feature, $call_param);
}
if ($line_fields[1] eq 'retval') {
$sysdeps_code .= "\tif (retval < 0) {\n";
$sysdeps_code .= "\t\tserver->glibtop_errno = -retval;\n";
$sysdeps_code .= "\t\tgoto do_return;\n";
$sysdeps_code .= "\t} else {\n\t\tserver->glibtop_errno = 0;\n\t}\n\n";
}
$sysdeps_code .= "\tgoto check_missing;\n";
if ($orig !~ /^@/) {