diff mbox series

[V2] swupdate-progress: fix psplash_fifo_dir

Message ID 20200504203346.17721-1-offougajoris@gmail.com
State Accepted
Headers show
Series [V2] swupdate-progress: fix psplash_fifo_dir | expand

Commit Message

Joris Offouga May 4, 2020, 8:33 p.m. UTC
Now psplash use /run for communication FIFO see [1].

To ensure compatibility with the old version, simply export the variable PSLASH_FIFO_DIR in your 'init script' instead of TMPDIR see [2].

[1]:http://git.yoctoproject.org/cgit/cgit.cgi/psplash/commit/?id=568f28ed8dc0cc79a0afc6f1689dc6cb007c285c
[2]: https://github.com/openembedded/openembedded-core/commit/b4063b16082604554c7c19b369ebddd27061f372#diff-fb5591034669824a855a9da88ab3b5c3

Signed-off-by: Joris Offouga <offougajoris@gmail.com>
---
changes v1 -> v2: 
	Improve commit log

 tools/swupdate-progress.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Stefano Babic May 4, 2020, 8:39 p.m. UTC | #1
On 04/05/20 22:33, Joris Offouga wrote:
> Now psplash use /run for communication FIFO see [1].
> 
> To ensure compatibility with the old version, simply export the variable PSLASH_FIFO_DIR in your 'init script' instead of TMPDIR see [2].
> 
> [1]:http://git.yoctoproject.org/cgit/cgit.cgi/psplash/commit/?id=568f28ed8dc0cc79a0afc6f1689dc6cb007c285c
> [2]: https://github.com/openembedded/openembedded-core/commit/b4063b16082604554c7c19b369ebddd27061f372#diff-fb5591034669824a855a9da88ab3b5c3
> 
> Signed-off-by: Joris Offouga <offougajoris@gmail.com>
> ---
> changes v1 -> v2: 
> 	Improve commit log
> 
>  tools/swupdate-progress.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/swupdate-progress.c b/tools/swupdate-progress.c
> index cd8abd1..01d926e 100644
> --- a/tools/swupdate-progress.c
> +++ b/tools/swupdate-progress.c
> @@ -174,7 +174,7 @@ int main(int argc, char **argv)
>  {
>  	int connfd;
>  	struct progress_msg msg;
> -	const char *tmpdir;
> +	const char *rundir;
>  	char psplash_pipe_path[256];
>  	int psplash_ok = 0;
>  	unsigned int curstep = 0;
> @@ -223,10 +223,10 @@ int main(int argc, char **argv)
>  		}
>  	}
>  		
> -	tmpdir = getenv("TMPDIR");
> -	if (!tmpdir)
> -		tmpdir = "/tmp";
> -	snprintf(psplash_pipe_path, sizeof(psplash_pipe_path), "%s/psplash_fifo", tmpdir);
> +	rundir = getenv("PSPLASH_FIFO_DIR");
> +	if (!rundir)
> +		rundir = "/run";
> +	snprintf(psplash_pipe_path, sizeof(psplash_pipe_path), "%s/psplash_fifo", rundir);
>  
>  
>  	connfd = -1;
> 

Acked-by: Stefano Babic <sbabic@denx.de>

Regards,
Stefano Babic
diff mbox series

Patch

diff --git a/tools/swupdate-progress.c b/tools/swupdate-progress.c
index cd8abd1..01d926e 100644
--- a/tools/swupdate-progress.c
+++ b/tools/swupdate-progress.c
@@ -174,7 +174,7 @@  int main(int argc, char **argv)
 {
 	int connfd;
 	struct progress_msg msg;
-	const char *tmpdir;
+	const char *rundir;
 	char psplash_pipe_path[256];
 	int psplash_ok = 0;
 	unsigned int curstep = 0;
@@ -223,10 +223,10 @@  int main(int argc, char **argv)
 		}
 	}
 		
-	tmpdir = getenv("TMPDIR");
-	if (!tmpdir)
-		tmpdir = "/tmp";
-	snprintf(psplash_pipe_path, sizeof(psplash_pipe_path), "%s/psplash_fifo", tmpdir);
+	rundir = getenv("PSPLASH_FIFO_DIR");
+	if (!rundir)
+		rundir = "/run";
+	snprintf(psplash_pipe_path, sizeof(psplash_pipe_path), "%s/psplash_fifo", rundir);
 
 
 	connfd = -1;