1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Merge pull request #1043 from ailin-nemui/solaris10

fix realpath on old solaris
This commit is contained in:
ailin-nemui 2019-05-13 15:26:21 +02:00 committed by GitHub
commit 7654f30d04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -315,6 +315,15 @@ int config_write(CONFIG_REC *rec, const char *fname, int create_mode)
/* expand all symlinks; else we may replace a symlink with a regular file */
dest_name = realpath(base_name, NULL);
if (errno == EINVAL) {
/* variable path length not supported by glibc < 2.3, Solaris < 11 */
char resolved_path[PATH_MAX] = { 0 };
errno = 0;
if ((dest_name = realpath(base_name, resolved_path)) != NULL) {
dest_name = g_strdup(dest_name);
}
}
if (dest_name == NULL) {
if (errno == ENOENT) {
dest_name = g_strdup(base_name);