summaryrefslogtreecommitdiff
blob: 8a66ecb715ef896b2d541223d04bbd3b4f790f76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
? gnome-pilot-0.1.65.tar.gz
? gnome-pilot.patch
? plhead.patch
? gpilotd/gpilotd.patch
? macros/macros.dep
? utils/make-password.patch
Index: gpilotd/gpilotd.c
===================================================================
RCS file: /cvs/gnome/gnome-pilot/gpilotd/gpilotd.c,v
retrieving revision 1.125
diff -u -r1.125 gpilotd.c
--- gpilotd/gpilotd.c	3 Dec 2001 11:00:31 -0000	1.125
+++ gpilotd/gpilotd.c	23 Apr 2002 10:36:22 -0000
@@ -46,6 +46,7 @@
 #include <signal.h>
 #include <unistd.h>
 #include <stdio.h>
+#include <fcntl.h>
 
 #include <libgnome/libgnome.h>
 
@@ -118,20 +119,20 @@
 pilot_connect (GPilotDevice *device,int *error) 
 {
 	struct pi_sockaddr addr;
-	int sd;
+	int sd, listen_sd;
 	int ret;
     
 	if (device->type != PILOT_DEVICE_NETWORK) {
 		pilot_set_baud_rate (device);
 	}
 
-	if (!(sd = pi_socket (PI_AF_SLP, PI_SOCK_STREAM, PI_PF_PADP))) {
+	if (!(listen_sd = pi_socket (PI_AF_PILOT, PI_SOCK_STREAM, PI_PF_DLP))) {
 		g_warning ("pi_socket: %s",strerror (errno));
 		if (error) *error = 1;
 		return -1;
 	}
 	
-	addr.pi_family = PI_AF_SLP;
+	addr.pi_family = PI_AF_PILOT;
 
 /*
 	Most important for networking
@@ -145,29 +146,38 @@
 
 	strcpy (addr.pi_device,device->port);
 
-	ret = pi_bind (sd, (struct sockaddr*)&addr, sizeof (addr));
+	ret = pi_bind (listen_sd, (struct sockaddr*)&addr, sizeof (addr));
 	if (ret == -1) {
 		g_warning (_("Unable to bind to pilot"));
-		if (error) *error = 1;
+		if (error)
+			*error = 1;
+		pi_close(listen_sd);
 		return 0;
 	}
 
-	ret = pi_listen (sd,1);
+	ret = pi_listen (listen_sd, 1);
 	if (ret != 0) {
 		g_warning ("pi_listen: %s", strerror (errno));
-		if (error) *error = 2;
+		if (error)
+			*error = 2;
+		pi_close(listen_sd);
 		return 0;
 	}
 
-	sd = pi_accept_to (sd, NULL,0, device->timeout); 
+	sd = pi_accept_to (listen_sd, NULL,0, device->timeout); 
 	if (sd == -1) {
 		g_warning ("pi_accept_to: %s", strerror (errno));
 		g_warning ("pi_accept_to: timeout was %d secs", device->timeout);
-		if (error) *error = 2;
+		if (error)
+			*error = 2;
+		pi_close(listen_sd);
 		return 0;
 	}
 
-	if (error) *error = 0;
+	if (error)
+		*error = 0;
+	pi_close(listen_sd);
+	
 	return sd;
 }
 
@@ -634,7 +644,6 @@
 			}
 		}
 		pilot_disconnect (pfd);
-		close (pfd);
 	} else {
 		if (connect_error==1) return FALSE; /* remove this device */
 		else return TRUE;
@@ -830,6 +839,10 @@
 		if (line[0] == 'S') {
 			if (!strncmp (line + 4, "Product=Handspring Visor",
 				      24)) {
+				visor_exists = TRUE;
+				break;
+			} else if (!strncmp (line + 4, "Product=Palm Handheld",
+				      21)) {
 				visor_exists = TRUE;
 				break;
 			}
Index: macros/gnome-pilot.m4
===================================================================
RCS file: /cvs/gnome/gnome-common/macros/gnome-pilot.m4,v
retrieving revision 1.40
diff -u -r1.40 gnome-pilot.m4
--- macros/gnome-pilot.m4	5 Mar 2002 16:57:29 -0000	1.40
+++ macros/gnome-pilot.m4	23 Apr 2002 10:36:22 -0000
@@ -25,7 +25,7 @@
 	else
 	    PISOCK_CFLAGS="-I$withval/include"
 	    incdir="$withval/include"
-	    PISOCK_LIBS="-L$withval/lib -lpisock"
+	    PISOCK_LIBS="-L$withval/lib -lpisock -lpisync"
 	    AC_MSG_CHECKING("for existance of $withval/lib/libpisock.so")
 	    if test -r $withval/lib/libpisock.so; then
 		AC_MSG_RESULT("yes")
Index: utils/make-password.c
===================================================================
RCS file: /cvs/gnome/gnome-pilot/utils/make-password.c,v
retrieving revision 1.4
diff -u -r1.4 make-password.c
--- utils/make-password.c	27 Feb 2000 12:04:00 -0000	1.4
+++ utils/make-password.c	23 Apr 2002 10:36:22 -0000
@@ -34,16 +34,16 @@
   char salt[3];
 
   if (argc < 2) {
-    fprintf(stderr,"usage:%s %s\n",argv[0],TTYPrompt);
+    fprintf(stderr,"usage:%s\n",argv[0]);
     exit(2);
   }
-  if (!(sd = pi_socket(PI_AF_SLP, PI_SOCK_STREAM, PI_PF_PADP))) {
+  if (!(sd = pi_socket(PI_AF_PILOT, PI_SOCK_STREAM, PI_PF_PADP))) {
     perror("pi_socket");
     exit(1);
   }
     
-  addr.pi_family = PI_AF_SLP;
-  strcpy(addr.pi_device,argv[1]);
+  addr.pi_family = PI_AF_PILOT;
+//  strcpy(addr.pi_device,argv[1]);
   
   ret = pi_bind(sd, (struct sockaddr*)&addr, sizeof(addr));
   if(ret == -1) {