always unlock mutex on errors

This commit is contained in:
Linus Dierheimer
2021-04-07 18:46:51 +02:00
parent c698080581
commit 9321241830
3 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
# fastfetch
fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch) like tool for fetching system information and displaying them in a pretty way. It is written in c to achieve much better performance, in return only linux is supported.
fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch) like tool for fetching system information and displaying them in a pretty way. It is written in c to achieve much better performance, in return only linux is supported. Additional it uses mechanismen like multithreading and caching to finish as fast as possible.
The output on my personal machine with default configurations looks like this:
![example output](screenshots/example.png)
+1
View File
@@ -42,6 +42,7 @@ void ffCalculatePlasma(FFinstance* instance, FFstrbuf** themeNamePtr, FFstrbuf**
if(kdeglobals == NULL)
{
ffStrbufDestroy(&kdeglobalsFile);
pthread_mutex_unlock(&mutex);
return;
}
+1 -3
View File
@@ -39,6 +39,7 @@ void ffCalculateWM(FFinstance* instance, FFstrbuf** prettyNamePtr, FFstrbuf** pr
if(proc == NULL)
{
ffStrbufSetS(&error, "opendir(\"/proc/\") == NULL");
pthread_mutex_unlock(&mutex);
return;
}
@@ -64,10 +65,7 @@ void ffCalculateWM(FFinstance* instance, FFstrbuf** prettyNamePtr, FFstrbuf** pr
closedir(proc);
if(prettyName.length == 0)
{
ffStrbufSetS(&error, "No process name matches the name of known display managers");
return;
}
pthread_mutex_unlock(&mutex);
}