From f546b3dfa7d104312c4c69af87005259eadd552f Mon Sep 17 00:00:00 2001 From: Marcel Alexandru Nitan Date: Mon, 22 May 2023 09:51:35 +0000 Subject: [PATCH] Use stdio printf instead of iostream --- src/configfsisomanager.cpp | 5 +++-- src/main.cpp | 5 ++--- src/util.cpp | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/configfsisomanager.cpp b/src/configfsisomanager.cpp index b444688..a6f1bdc 100644 --- a/src/configfsisomanager.cpp +++ b/src/configfsisomanager.cpp @@ -1,4 +1,4 @@ -#include + #include #include @@ -7,6 +7,7 @@ #include #include #include +#include bool supported() { @@ -68,7 +69,7 @@ void mount_iso(char *iso_path, char *cdrom, char *ro) char *gadgetRoot = get_gadget_root(); if (gadgetRoot == nullptr) { - std::cerr << "No active gadget found" << std::endl; + printf("No active gadget found\n"); return; } char *configRoot = get_config_root(); diff --git a/src/main.cpp b/src/main.cpp index aef8640..81ba960 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,4 @@ #include "configfsisomanager.h" -#include #include #include @@ -10,12 +9,12 @@ int main(int argc, char* argv[]){ if (!supported()) { - std::cerr << "Device does not support configfs usb gadget" << std::endl; + printf("Device does not support configfs usb gadget\n"); return 1; } if (getuid() != 0) { - std::cerr << "Permission denied" << std::endl; + printf("Permission denied\n"); return 1; } if (argc == 1) diff --git a/src/util.cpp b/src/util.cpp index 8f60d8b..b2cb142 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include @@ -58,7 +57,7 @@ bool isdir(char *path) void sysfs_write(char *path, char *content) { - std::cout << "Write: " << content << " -> " << path << std::endl; + printf("Write: %s -> %s\n", content, path); std::ofstream sysfsFile(path); sysfsFile << content << std::endl; sysfsFile.close();