Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 948484 - x11-misc/tint2-17.1.3 error: "tint2: Could not save icon theme cache!"
Summary: x11-misc/tint2-17.1.3 error: "tint2: Could not save icon theme cache!"
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Amy Liffey
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2025-01-21 08:00 UTC by gen2dev
Modified: 2025-01-25 15:37 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
save_cache() patch (tint2-17.1.3_save_cache.patch,1.01 KB, patch)
2025-01-21 08:01 UTC, gen2dev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description gen2dev 2025-01-21 08:00:05 UTC
In the nick87720z fork of tint2 this commit:
   "Optimizations", 26 Feb 2022:
   https://gitlab.com/nick87720z/tint2/-/commit/e3699ceb8614ca0b73fa543bd1fcd47b24bee67b
broke save_cache().

Nothing gets written to the cache and .xsession-errors shows:
   tint2: Saving icon theme cache...
   tint2: Could not save icon theme cache!

The commit changed 'fopen(cache_path, "w")' to 'fdopen(fd, "w")', trying to
reuse an fd that is already open for the same file (for locking). But that fd
was opened O_RDONLY and fdopen() doesn't allow an incompatible mode (opening
an O_RDONLY fd for writing).

This patch restores the original fopen(cache_path, "w") and the cache works again.

I reported it upstream for visibility but it doesn't look like there will be any action there.



Reproducible: Always

Steps to Reproduce:
1. Delete the $HOME/.cache/tint2/icon.cache file.
2. Start tint2 so it will load some theme icons and try to cache their paths.
3. Look at the cache file created and at messages in .xsession-errors.
Actual Results:  
A 0-byte icon.cache file is created and .xsession-errors shows:
   tint2: Saving icon theme cache...
   tint2: Could not save icon theme cache!


Expected Results:  
Non-0 icon.cache file, and no error message in .xsession-errors.
Comment 1 gen2dev 2025-01-21 08:01:59 UTC
Created attachment 917200 [details, diff]
save_cache() patch