Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
agent
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simmctic
agent
Commits
1beb363f
Commit
1beb363f
authored
8 years ago
by
Clara Daia Hilgenberg Daru
Browse files
Options
Downloads
Patches
Plain Diff
Correct error message type
parent
1b94f214
No related branches found
No related tags found
1 merge request
!51
Merge development to master
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/linux/get_distro.cpp
+8
-8
8 additions, 8 deletions
src/linux/get_distro.cpp
src/linux/get_macaddr.cpp
+1
-1
1 addition, 1 deletion
src/linux/get_macaddr.cpp
src/linux/get_user_count.cpp
+2
-2
2 additions, 2 deletions
src/linux/get_user_count.cpp
with
11 additions
and
11 deletions
src/linux/get_distro.cpp
+
8
−
8
View file @
1beb363f
...
...
@@ -62,7 +62,7 @@ std::string get_distro() {
}
}
throw
"Release file empty or incomplete."
;
throw
std
::
string
(
"Release file empty or incomplete."
)
;
// openSuSE
}
else
if
(
open_file
(
"/etc/os-release"
,
release_file
))
{
...
...
@@ -102,7 +102,7 @@ std::string get_distro() {
if
(
name
.
length
())
return
name
;
throw
"Release file empty or incomplete."
;
throw
std
::
string
(
"Release file empty or incomplete."
)
;
}
else
if
(
open_file
(
"/etc/novell-release"
,
release_file
))
{
...
...
@@ -111,7 +111,7 @@ std::string get_distro() {
if
(
line
.
length
())
return
line
;
throw
"Release file empty."
;
throw
std
::
string
(
"Release file empty."
)
;
}
else
if
(
open_file
(
"/etc/sles-release"
,
release_file
))
{
...
...
@@ -120,7 +120,7 @@ std::string get_distro() {
if
(
line
.
length
())
return
line
;
throw
"Release file empty."
;
throw
std
::
string
(
"Release file empty."
)
;
// fedora
}
else
if
(
open_file
(
"/etc/redhat-release"
,
release_file
))
{
...
...
@@ -130,7 +130,7 @@ std::string get_distro() {
if
(
line
.
length
())
return
line
;
throw
"Release file empty."
;
throw
std
::
string
(
"Release file empty."
)
;
// debian -- leave this at the end, otherwise debian-based distros
// will find the debian_version file instead of the actual
...
...
@@ -142,7 +142,7 @@ std::string get_distro() {
if
(
line
.
length
())
return
line
;
throw
"Release file empty."
;
throw
std
::
string
(
"Release file empty."
)
;
}
else
if
(
open_file
(
"/etc/debian-version"
,
release_file
))
{
...
...
@@ -151,9 +151,9 @@ std::string get_distro() {
if
(
line
.
length
())
return
line
;
throw
"Release file empty."
;
throw
std
::
string
(
"Release file empty."
)
;
}
throw
"No release file found."
;
throw
std
::
string
(
"No release file found."
)
;
}
This diff is collapsed.
Click to expand it.
src/linux/get_macaddr.cpp
+
1
−
1
View file @
1beb363f
...
...
@@ -31,7 +31,7 @@ std::string get_macaddr() {
if
(
!
file
.
is_open
())
{
file
.
open
(
"/sys/class/net/eth1/address"
,
std
::
ifstream
::
in
);
if
(
!
file
.
is_open
())
{
throw
"No address file found."
;
throw
std
::
string
(
"No address file found."
)
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/linux/get_user_count.cpp
+
2
−
2
View file @
1beb363f
...
...
@@ -432,7 +432,7 @@ static struct user_log * last_modified() {
p
=
(
struct
utmplist
*
)
malloc
(
sizeof
(
struct
utmplist
));
if
(
p
==
NULL
)
{
throw
"ERROR: out of memory"
;
throw
std
::
string
(
"ERROR: out of memory"
)
;
}
memcpy
(
&
p
->
ut
,
&
ut
,
sizeof
(
struct
utmp
));
...
...
@@ -550,7 +550,7 @@ static struct user_log * last_modified() {
break
;
p
=
(
struct
utmplist
*
)
malloc
(
sizeof
(
struct
utmplist
));
if
(
p
==
NULL
)
{
throw
"ERROR: out of memory"
;
throw
std
::
string
(
"ERROR: out of memory"
)
;
}
memcpy
(
&
p
->
ut
,
&
ut
,
sizeof
(
struct
utmp
));
p
->
next
=
utmplist
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment