--- gpilotd/gpilotd.c~	2005-06-25 02:13:04.000000000 -0400
+++ gpilotd/gpilotd.c	2005-06-25 02:13:44.000000000 -0400
@@ -147,7 +147,7 @@
 		break;
 	}
 	
-	if (!(listen_sd = pi_socket (PI_AF_PILOT, PI_SOCK_STREAM, pf))) {
+	if ((listen_sd = pi_socket (PI_AF_PILOT, PI_SOCK_STREAM, pf)) < 0) {
 		g_warning ("pi_socket: %s",strerror (errno));
 		if (error) *error = 1;
 		return -1;
@@ -164,7 +164,7 @@
 	}
 
 	ret = pi_bind (listen_sd, device->port);
-	if (ret == -1) {
+	if (ret < 0) {
 		g_warning (_("Unable to bind to pilot"));
 		if (error)
 			*error = 1;
@@ -173,7 +173,7 @@
 	}
 
 	ret = pi_listen (listen_sd, 1);
-	if (ret != 0) {
+	if (ret < 0) {
 		g_warning ("pi_listen: %s", strerror (errno));
 		if (error)
 			*error = 2;
@@ -182,7 +182,7 @@
 	}
 
 	sd = pi_accept_to (listen_sd, NULL,0, device->timeout); 
-	if (sd == -1) {
+	if (sd < 0) {
 		g_warning ("pi_accept_to: %s", strerror (errno));
 		g_warning ("pi_accept_to: timeout was %d secs", device->timeout);
 		if (error)
