Skip to content

Commit f76f570

Browse files
committed
Fix curdir
1 parent b345784 commit f76f570

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

runtime/flang/curdir.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#ifndef _WIN32
2020
#include <sys/param.h>
2121
#include <sys/utsname.h>
22+
#else
23+
#include <Winsock2.h>
2224
#endif
2325
#include <stdlib.h>
2426
#include "stdioInterf.h"
@@ -117,6 +119,8 @@ void __fort_gethostname(host) char *host;
117119
}
118120
strcpy(host, p);
119121
#else
120-
strcpy(host, "localhost");
122+
char temp[128] = "";
123+
gethostname(host, sizeof(temp));
124+
strcpy(host, temp);
121125
#endif
122126
}

0 commit comments

Comments
 (0)