If your application has a permanent registration with the portmapper you do not need to unregister your RPC program number.
/* Unregister the event manager rendezvous,
* using the same parameters we registered with:
*/
if (!netmgt_unregister_rendez(myname,
myname, rendez, NETMGT_VERS,
NETMGT_ANY_AGENT, NETMGT_LOW_PRIORITY,
timeout))
(void)fprintf(stderr, "Can't unregister from the event dispatcher: %s\n",
netmgt_sperror());
(void) netmgt_unregister_callback(rendez, NETMGT_VERS);