mirror of
https://github.com/nitanmarcel/isodrive.git
synced 2026-03-13 04:17:24 +00:00
Use stdio printf instead of iostream
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
#include <iostream>
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
bool supported()
|
bool supported()
|
||||||
{
|
{
|
||||||
@@ -68,7 +69,7 @@ void mount_iso(char *iso_path, char *cdrom, char *ro)
|
|||||||
char *gadgetRoot = get_gadget_root();
|
char *gadgetRoot = get_gadget_root();
|
||||||
if (gadgetRoot == nullptr)
|
if (gadgetRoot == nullptr)
|
||||||
{
|
{
|
||||||
std::cerr << "No active gadget found" << std::endl;
|
printf("No active gadget found\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
char *configRoot = get_config_root();
|
char *configRoot = get_config_root();
|
||||||
|
|||||||
+2
-3
@@ -1,5 +1,4 @@
|
|||||||
#include "configfsisomanager.h"
|
#include "configfsisomanager.h"
|
||||||
#include <iostream>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
@@ -10,12 +9,12 @@ int main(int argc, char* argv[]){
|
|||||||
|
|
||||||
if (!supported())
|
if (!supported())
|
||||||
{
|
{
|
||||||
std::cerr << "Device does not support configfs usb gadget" << std::endl;
|
printf("Device does not support configfs usb gadget\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (getuid() != 0)
|
if (getuid() != 0)
|
||||||
{
|
{
|
||||||
std::cerr << "Permission denied" << std::endl;
|
printf("Permission denied\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (argc == 1)
|
if (argc == 1)
|
||||||
|
|||||||
+1
-2
@@ -4,7 +4,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <iostream>
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <array>
|
#include <array>
|
||||||
@@ -58,7 +57,7 @@ bool isdir(char *path)
|
|||||||
|
|
||||||
void sysfs_write(char *path, char *content)
|
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);
|
std::ofstream sysfsFile(path);
|
||||||
sysfsFile << content << std::endl;
|
sysfsFile << content << std::endl;
|
||||||
sysfsFile.close();
|
sysfsFile.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user