toolbox

Check-in [e75c5886d3]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:radios-check: fix memmove index
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:e75c5886d30e55e643852cf919bfa9e82e8f9bf48e11d69d9143750ec31004d9
User & Date: jef 2019-04-15 20:36:44
Context
2019-04-16
12:26
radios-check: remove superfluous polling check-in: 90f21a92ca user: jef tags: trunk
2019-04-15
20:36
radios-check: fix memmove index check-in: e75c5886d3 user: jef tags: trunk
20:12
radios-check: use <sys/queue.h> + job management cleanup check-in: 7780f9a20b user: jef tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/radios-check/radios-check.c.

238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
	fd[0].fd = job.fd;
	fd[0].events = POLLIN;
	if (poll(fd, 1, 0) > 0) {
		if (read(job.fd, &job.res, sizeof(job.res)) == sizeof(job.res))
			job.res.radio->ok = job.res.ok;
	}
	close(job.fd);
	memmove(jobs + i, jobs + i + 1, (size - i) * sizeof(struct job));
}

void
radios_pcheck(struct radios *radios)
{
	struct radio *radio;
	size_t nthreads = 20;







|







238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
	fd[0].fd = job.fd;
	fd[0].events = POLLIN;
	if (poll(fd, 1, 0) > 0) {
		if (read(job.fd, &job.res, sizeof(job.res)) == sizeof(job.res))
			job.res.radio->ok = job.res.ok;
	}
	close(job.fd);
	memmove(jobs + i, jobs + i + 1, (size - i - 1) * sizeof(struct job));
}

void
radios_pcheck(struct radios *radios)
{
	struct radio *radio;
	size_t nthreads = 20;