Skip to content

Commit de1cb4d

Browse files
committed
fix: remove line
1 parent f1cf4ad commit de1cb4d

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

dosetup/main.cpp

+13-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
#include "logtofile.h"
1111
#include <filesystem>
1212

13+
1314
static const std::string STR_DTPARAM = "dtparam=audio";
1415
static const std::string STR_DTOVERLAY = "dtoverlay=";
1516
static const std::string STR_LOCAL = "127.0.1.1";
17+
static const std::string STR_VC4 = "dtoverlay=vc4-kms-v3d";
1618

1719
int SetHostname(const std::string& sHostname)
1820
{
@@ -131,7 +133,6 @@ int SetOverlay(const std::string& sOverlay, const std::string& sLineNumber, cons
131133
}
132134

133135
std::string sLine;
134-
std::string sFind = "dtoverlay=vc4-fkms-v3d";
135136
int nCount = 0;
136137
bool bAdded(false);
137138
bool bRotateDone(false);
@@ -171,10 +172,14 @@ int SetOverlay(const std::string& sOverlay, const std::string& sLineNumber, cons
171172
}
172173
bRotateDone = true;
173174
}
174-
else if(sLine.substr(0,sFind.length()) != sFind)
175+
else if(sLine.substr(0,STR_VC4.length()) != STR_VC4)
175176
{
176177
output << sLine << '\n';
177178
}
179+
else
180+
{
181+
std::cout << "removed" << std::endl;
182+
}
178183
nCount++;
179184
}
180185
if(!bAdded)
@@ -235,6 +240,7 @@ int main(int argc, char* argv[])
235240
pmlLog(pml::LOG_ERROR, "dosetup") << "Not enough arguments. Need 6 given " << argc;
236241
pmlLog(pml::LOG_INFO, "dosetup") << "Usage: hostname password overlay line_to_replace";
237242
pml::LogStream::Stop();
243+
std::cout << "STOPPED" << std::endl;
238244
return -1;
239245
}
240246

@@ -243,6 +249,7 @@ int main(int argc, char* argv[])
243249
{
244250
pmlLog(pml::LOG_CRITICAL, "dosetup") << "Failed to set hostname. Exiting";
245251
pml::LogStream::Stop();
252+
std::cout << "STOPPED" << std::endl;
246253

247254
return -1;
248255
}
@@ -251,6 +258,7 @@ int main(int argc, char* argv[])
251258
{
252259
pmlLog(pml::LOG_CRITICAL, "dosetup") << "Failed to set password. Exiting";
253260
pml::LogStream::Stop();
261+
std::cout << "STOPPED" << std::endl;
254262

255263
return -1;
256264
}
@@ -259,12 +267,15 @@ int main(int argc, char* argv[])
259267
if(SetOverlay(argv[3], argv[4], argv[5]) != 0)
260268
{
261269
pml::LogStream::Stop();
270+
std::cout << "STOPPED" << std::endl;
262271
return -1;
263272
}
264273

265274
SetRotate(argv[5]);
266275

267276
pmlLog(pml::LOG_INFO, "dosetup") << "------ FINISHED ------";
268277
pml::LogStream::Stop();
278+
std::cout << "STOPPED" << std::endl;
279+
269280
return 0;
270281
}

0 commit comments

Comments
 (0)