65 {
66
67 char *saveptr = NULL;
69
70 while ((str = strtok_r(str ? NULL : data, "\n", &saveptr))) {
72 if (strcmp(str + strlen(
STATUS_STR),
"OK") == 0) {
74 } else {
76 }
78 unsigned long v_maj = 0;
79 unsigned long v_min = 0;
80 unsigned long v_pat = 0;
81
83 if (sscanf(str, "%lu.%lu.%lu", &v_maj, &v_min, &v_pat) == 0) {
84 DBG_ERR(
"Unable to parse version string");
85 continue;
86 }
87
92 char *endptr;
93 unsigned long pid;
94
96 errno = 0;
97 pid = strtoul(str, &endptr, 0);
98 if ((errno == ERANGE && pid == ULONG_MAX) || (errno != 0 && pid == 0)) {
99 continue;
100 }
101
102 if (endptr == str || pid == 0) {
103 continue;
104 }
105
106 connector->
pid = pid;
109 sizeof(connector->
address) - 1);
111 char *endptr;
112 unsigned long port;
113
115 errno = 0;
116 port = strtoul(str, &endptr, 0);
117 if ((errno == ERANGE && port == ULONG_MAX) || (errno != 0 && port == 0)) {
118 continue;
119 }
120
121 if (endptr == str || port == 0) {
122 continue;
123 }
124
125 connector->
port = port;
126 }
127 }
128
129 DBG_INFO(
"response from connector");
136
137 return;
138}