aboutsummaryrefslogtreecommitdiffstats
path: root/Settings.c
diff options
context:
space:
mode:
authorEugene V. Lyubimkin <jackyf@debian.org>2012-12-01 11:55:43 +0200
committerDaniel Lange <DLange@git.local>2016-04-11 13:00:32 +0200
commit204a191cc68fa15147b2dcfc2711665bd88f758e (patch)
treed7c63186e2aca725938bc4a308d58a5f8789df16 /Settings.c
parentd8bd1d8d45f42b28bd4674a5e88d0aa349f887c3 (diff)
parent2004bbc3ef28ada3acca05f5d5fa9108121a6784 (diff)
downloaddebian_htop-204a191cc68fa15147b2dcfc2711665bd88f758e.tar.gz
debian_htop-204a191cc68fa15147b2dcfc2711665bd88f758e.tar.bz2
debian_htop-204a191cc68fa15147b2dcfc2711665bd88f758e.zip
Imported Debian patch 1.0.2-1debian/1.0.2-1
Diffstat (limited to 'Settings.c')
-rw-r--r--Settings.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Settings.c b/Settings.c
index f2573e8..fd200a7 100644
--- a/Settings.c
+++ b/Settings.c
@@ -124,6 +124,8 @@ static bool Settings_read(Settings* this, char* fileName, int cpuCount) {
this->pl->detailedCPUTime = atoi(option[1]);
} else if (String_eq(option[0], "cpu_count_from_zero")) {
this->pl->countCPUsFromZero = atoi(option[1]);
+ } else if (String_eq(option[0], "update_process_names")) {
+ this->pl->updateProcessNames = atoi(option[1]);
} else if (String_eq(option[0], "delay")) {
this->delay = atoi(option[1]);
} else if (String_eq(option[0], "color_scheme")) {
@@ -183,6 +185,7 @@ bool Settings_write(Settings* this) {
fprintf(fd, "header_margin=%d\n", (int) this->header->margin);
fprintf(fd, "detailed_cpu_time=%d\n", (int) this->pl->detailedCPUTime);
fprintf(fd, "cpu_count_from_zero=%d\n", (int) this->pl->countCPUsFromZero);
+ fprintf(fd, "update_process_names=%d\n", (int) this->pl->updateProcessNames);
fprintf(fd, "color_scheme=%d\n", (int) this->colorScheme);
fprintf(fd, "delay=%d\n", (int) this->delay);
fprintf(fd, "left_meters=");
@@ -239,7 +242,9 @@ Settings* Settings_new(ProcessList* pl, Header* header, int cpuCount) {
mkdir(htopDir, 0700);
free(htopDir);
free(configDir);
- if (access(legacyDotfile, R_OK) != 0) {
+ struct stat st;
+ lstat(legacyDotfile, &st);
+ if (access(legacyDotfile, R_OK) != 0 || S_ISLNK(st.st_mode)) {
free(legacyDotfile);
legacyDotfile = NULL;
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy