[04/10] Revert "parse: add a helper to obtain an uptime"

Submitted by Pavel Tikhomirov on April 3, 2018, 9:34 a.m.

Details

Message ID 20180403093426.10894-5-ptikhomirov@virtuozzo.com
State Accepted
Series "don't use wrong pagemap (from other task) on pid reuse"
Commit 9b0003676a65cc6affff92b898b0c33c7e3a51c0
Headers show

Commit Message

Pavel Tikhomirov April 3, 2018, 9:34 a.m.
This reverts commit cf2f035d9f5cdca96c814bd26e24c556ad736171.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 criu/include/proc_parse.h |  1 -
 criu/proc_parse.c         | 24 ------------------------
 2 files changed, 25 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/include/proc_parse.h b/criu/include/proc_parse.h
index c68566130..0f5e91056 100644
--- a/criu/include/proc_parse.h
+++ b/criu/include/proc_parse.h
@@ -108,6 +108,5 @@  int parse_children(pid_t pid, pid_t **_c, int *_n);
 
 extern bool is_vma_range_fmt(char *line);
 extern void parse_vmflags(char *buf, u32 *flags, u64 *madv, int *io_pf);
-extern int parse_uptime(struct timeval *_tv);
 
 #endif /* __CR_PROC_PARSE_H__ */
diff --git a/criu/proc_parse.c b/criu/proc_parse.c
index 5aabed1eb..4ab11a31a 100644
--- a/criu/proc_parse.c
+++ b/criu/proc_parse.c
@@ -2712,27 +2712,3 @@  int parse_children(pid_t pid, pid_t **_c, int *_n)
 	xfree(ch);
 	return -1;
 }
-
-__maybe_unused int parse_uptime(struct timeval *_tv)
-{
-	unsigned long sec, csec;
-	FILE *f;
-
-	f = fopen("/proc/uptime", "r");
-	if (!f) {
-		pr_perror("Failed to fopen /proc/uptime");
-		return -1;
-	}
-
-	if (fscanf(f, "%lu.%2lu", &sec, &csec) != 2) {
-		pr_perror("Failed to parse /proc/uptime");
-		fclose(f);
-		return -1;
-	}
-
-	_tv->tv_sec = sec;
-	_tv->tv_usec = csec * (USEC_PER_SEC / 100);
-
-	fclose(f);
-	return 0;
-}