diff --git a/lib/lib.pl b/lib/lib.pl index 5fb09eac..f5502b96 100755 --- a/lib/lib.pl +++ b/lib/lib.pl @@ -36,6 +36,10 @@ print 'static void'; print '_glibtop_missing_feature (glibtop *server, const char *feature,'; print "\t\t\t const u_int64_t present, u_int64_t *required)"; print '{'; +print "\tu_int64_t old_required = *required;\n"; +print "\t/* Return if we have all required fields. */"; +print "\tif ((~present & old_required) == 0)"; +print "\t\treturn;\n"; print "\tswitch (server->error_method) {"; print "\tcase GLIBTOP_ERROR_METHOD_WARN_ONCE:"; print "\t\t*required &= present;"; @@ -43,13 +47,13 @@ print "\tcase GLIBTOP_ERROR_METHOD_WARN:"; print "\t\tglibtop_warn_r (server,"; print "\t\t\t\t_(\"glibtop_get_%s (): Client requested \""; print "\t\t\t\t \"field mask %05Lx, but only have %05Lx.\"),"; -print "\t\t\t\t feature, required, present);"; +print "\t\t\t\t feature, old_required, present);"; print "\t\tbreak;"; print "\tcase GLIBTOP_ERROR_METHOD_ABORT:"; print "\t\tglibtop_error_r (server,"; print "\t\t\t\t _(\"glibtop_get_%s (): Client requested \""; print "\t\t\t\t \"field mask %05x, but only have %05x.\"),"; -print "\t\t\t\t feature, required, present);"; +print "\t\t\t\t feature, old_required, present);"; print "\t\tbreak;"; print "\t}"; print '}';