diff --git a/nsock/include/nsock.h b/nsock/include/nsock.h index e34f090e2..36f4a76eb 100644 --- a/nsock/include/nsock.h +++ b/nsock/include/nsock.h @@ -381,10 +381,13 @@ nsock_iod nsi_new2(nsock_pool nsockp, int sd, void *userdata); * notification to each event), NSOCK_PENDING_SILENT (do not send notification * to the killed events), or NSOCK_PENDING_ERROR (print an error message and * quit the program) */ -#define NSOCK_PENDING_NOTIFY 1 -#define NSOCK_PENDING_SILENT 2 -#define NSOCK_PENDING_ERROR 4 -void nsi_delete(nsock_iod nsockiod, int pending_response); +enum nsock_del_mode { + NSOCK_PENDING_NOTIFY, + NSOCK_PENDING_SILENT, + NSOCK_PENDING_ERROR, +}; + +void nsi_delete(nsock_iod nsockiod, enum nsock_del_mode pending_response); /* Sometimes it is useful to store a pointer to information inside * the nsiod so you can retrieve it during a callback. */ diff --git a/nsock/src/nsock_iod.c b/nsock/src/nsock_iod.c index 935eea0b5..88b3c0953 100644 --- a/nsock/src/nsock_iod.c +++ b/nsock/src/nsock_iod.c @@ -170,7 +170,7 @@ int socket_count_zero(msiod *iod, mspool *ms); * notification to each event), NSOCK_PENDING_SILENT (do not send notification * to the killed events), or NSOCK_PENDING_ERROR (print an error message and * quit the program) */ -void nsi_delete(nsock_iod nsockiod, int pending_response) { +void nsi_delete(nsock_iod nsockiod, enum nsock_del_mode pending_response) { msiod *nsi = (msiod *)nsockiod; gh_lnode_t *evlist_ar[3]; gh_list_t *corresp_list[3];