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:
committed by
Martin Baulig
parent
d66768ac55
commit
d86a386ad8
@@ -1,3 +1,11 @@
|
|||||||
|
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.
|
||||||
|
|
||||||
1999-12-22 Martin Baulig <martin@home-of-linux.org>
|
1999-12-22 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
* glibtop.h (glibtop): Added `glibtop_errno' field.
|
* glibtop.h (glibtop): Added `glibtop_errno' field.
|
||||||
|
@@ -46,6 +46,9 @@ BEGIN_LIBGTOP_DECLS
|
|||||||
char *
|
char *
|
||||||
glibtop_get_error_string_l (glibtop *server, unsigned error_number);
|
glibtop_get_error_string_l (glibtop *server, unsigned error_number);
|
||||||
|
|
||||||
|
unsigned
|
||||||
|
glibtop_get_errno_l (glibtop *server);
|
||||||
|
|
||||||
END_LIBGTOP_DECLS
|
END_LIBGTOP_DECLS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -44,3 +44,9 @@ glibtop_get_error_string_l (glibtop *server, unsigned error_number)
|
|||||||
|
|
||||||
return glibtop_strdup_r (server, _(glibtop_error_strings [error_number]));
|
return glibtop_strdup_r (server, _(glibtop_error_strings [error_number]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned
|
||||||
|
glibtop_get_errno_l (glibtop *server)
|
||||||
|
{
|
||||||
|
return server->glibtop_errno;
|
||||||
|
}
|
||||||
|
@@ -221,6 +221,14 @@ sub output {
|
|||||||
$sysdeps_code .= sprintf ("\t%sglibtop_get_%s_s (server, buf%s);\n",
|
$sysdeps_code .= sprintf ("\t%sglibtop_get_%s_s (server, buf%s);\n",
|
||||||
$prefix, $feature, $call_param);
|
$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";
|
$sysdeps_code .= "\tgoto check_missing;\n";
|
||||||
|
|
||||||
if ($orig !~ /^@/) {
|
if ($orig !~ /^@/) {
|
||||||
|
Reference in New Issue
Block a user