Fastbootd: flashing certification
Change-Id: I564086908942463eebee69449d484ba03effc50e
diff --git a/fastbootd/utils.c b/fastbootd/utils.c
index 16e1c09..8205af4 100644
--- a/fastbootd/utils.c
+++ b/fastbootd/utils.c
@@ -34,6 +34,7 @@
#include <stdio.h>
#include <sys/ioctl.h>
#include <linux/fs.h>
+#include <stdlib.h>
#include "utils.h"
#include "debug.h"
@@ -145,3 +146,15 @@
return 0;
}
+int create_temp_file() {
+ char tempname[] = "/dev/fastboot_data_XXXXXX";
+ int fd;
+
+ fd = mkstemp(tempname);
+ if (fd < 0)
+ return -1;
+
+ unlink(tempname);
+
+ return fd;
+}