mirror of
https://github.com/clearlinux/hyperstart.git
synced 2026-09-03 20:21:47 +00:00
fix incorrect path of link file
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
This commit is contained in:
@@ -335,14 +335,17 @@ static int hyper_remove_nic(char *device)
|
||||
{
|
||||
char path[256], real[128];
|
||||
int fd;
|
||||
ssize_t size;
|
||||
|
||||
sprintf(path, "/sys/class/net/%s", device);
|
||||
|
||||
if (readlink(path, real, 128) < 0) {
|
||||
size = readlink(path, real, 128);
|
||||
if (size < 0 || size > 127) {
|
||||
perror("fail to read link directory");
|
||||
return -1;
|
||||
}
|
||||
|
||||
real[size] = '\0';
|
||||
sprintf(path, "/sys/%s/../../../remove", real + 5);
|
||||
|
||||
fprintf(stdout, "get net sys path %s\n", path);
|
||||
@@ -869,7 +872,7 @@ void hyper_cleanup_dns(struct hyper_pod *pod)
|
||||
int fd = open("/tmp/hyper/resolv.conf", O_WRONLY| O_TRUNC);
|
||||
|
||||
if (fd < 0) {
|
||||
perror("open /tmp/resolv.conf failed");
|
||||
perror("open /tmp/hyper/resolv.conf failed");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user