mailing list of musl libc
 help / color / mirror / code / Atom feed
d529de9c674fc91ceddf273c5eff36ee32c23666 blob 240 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
 
#include <unistd.h>
#include <stdio.h>
#include <stdint.h>

long gethostid()
{
	FILE *f;
	int32_t rv = 0;

	f = fopen("/etc/hostid", "reb");
	if (f) {
		if (fread(&rv, sizeof(rv), 1, f) == 0) {
			rv = 0;
		}
		fclose(f);
	}

	return rv;
}
debug log:

solving d529de9c ...
found d529de9c in https://inbox.vuxu.org/musl/20210420191519.23822-3-ericonr@disroot.org/
found 25bb35db in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 25bb35db862d297f92ff3931b1964373d48194d8	src/misc/gethostid.c

applying [1/1] https://inbox.vuxu.org/musl/20210420191519.23822-3-ericonr@disroot.org/
diff --git a/src/misc/gethostid.c b/src/misc/gethostid.c
index 25bb35db..d529de9c 100644

Checking patch src/misc/gethostid.c...
Applied patch src/misc/gethostid.c cleanly.

index at:
100644 d529de9c674fc91ceddf273c5eff36ee32c23666	src/misc/gethostid.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).