Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(787)

Side by Side Diff: fusl/src/misc/getdomainname.c

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #define _GNU_SOURCE 1 #define _GNU_SOURCE
2 #include <unistd.h> 2 #include <unistd.h>
3 #include <sys/utsname.h> 3 #include <sys/utsname.h>
4 #include <string.h> 4 #include <string.h>
5 #include <errno.h> 5 #include <errno.h>
6 6
7 int getdomainname(char *name, size_t len) 7 int getdomainname(char* name, size_t len) {
8 { 8 struct utsname temp;
9 » struct utsname temp; 9 uname(&temp);
10 » uname(&temp); 10 if (!len || strlen(temp.domainname) >= len) {
11 » if (!len || strlen(temp.domainname) >= len) { 11 errno = EINVAL;
12 » » errno = EINVAL; 12 return -1;
13 » » return -1; 13 }
14 » } 14 strcpy(name, temp.domainname);
15 » strcpy(name, temp.domainname); 15 return 0;
16 » return 0;
17 } 16 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698