shadow-maint / shadow

Upstream shadow tree
Other
290 stars 228 forks source link

lib/utmp.c: Use the appropriate autotools macros for struct utmpx #955

Closed alejandro-colomar closed 5 months ago

alejandro-colomar commented 5 months ago

Oops. I forgot to do a change.

Recently, we started using utmpx instead of utmp, and we updated
<./configure.ac> to do the checks for 'struct utmpx' instead of
'struct utmp'.  However, I forgot to update the preprocessor
conditionals accordingly.

Fixes: 64bcb54fa962 ("lib/, src/, configure.ac: Use utmpx instead of utmp") Link: https://github.com/shadow-maint/shadow/pull/954 Cc: @firasuke Cc: @awilfox Cc: @ikerexxe

alejandro-colomar commented 5 months ago

v2 changes:

$ git range-diff shadow/master gh/utmpx utmpx 
1:  8ca977f9 = 1:  8ca977f9 lib/utmp.c: Indent nested preprocessor conditionals
2:  ee54d49b = 2:  ee54d49b lib/utmp.c: Merge preprocessor conditionals
3:  e4b4664c ! 3:  1bc3b340 lib/utmp.c: Use defined() instead of #if[n]def
...
-:  -------- > 4:  7c7223df lib/utmp.c: Use defined() instead of #if[n]def
4:  5d9b0245 = 5:  fe88a9a0 lib/utmp.c: Use the appropriate autotools macro for struct utmpx

$ git diff 5d9b0245..fe88a9a0
$ 
alejandro-colomar commented 5 months ago

v2b changes:

$ git range-diff shadow/master gh/utmpx utmpx 
1:  8ca977f9 = 1:  8ca977f9 lib/utmp.c: Indent nested preprocessor conditionals
2:  ee54d49b = 2:  ee54d49b lib/utmp.c: Merge preprocessor conditionals
3:  1bc3b340 = 3:  1bc3b340 lib/utmp.c: Remove #endif comments
4:  7c7223df = 4:  7c7223df lib/utmp.c: Use defined() instead of #if[n]def
5:  fe88a9a0 ! 5:  52b4deef lib/utmp.c: Use the appropriate autotools macro for struct utmpx
    @@ Metadata
     Author: Alejandro Colomar <alx@kernel.org>

      ## Commit message ##
    -    lib/utmp.c: Use the appropriate autotools macro for struct utmpx
    +    lib/utmp.c: Use the appropriate autotools macros for struct utmpx

         Recently, we started using utmpx instead of utmp, and we updated
         <./configure.ac> to do the checks for 'struct utmpx' instead of
alejandro-colomar commented 5 months ago

On Tue, Feb 20, 2024 at 11:41:19PM -0800, Iker Pedrosa wrote:

@ikerexxe approved this pull request.

LGTM!

v2c changes:

$ git range-diff shadow/master 52b4deef utmpx 1: 8ca977f9 ! 1: bceeefe2 lib/utmp.c: Indent nested preprocessor conditionals @@ Metadata

Commit message

     lib/utmp.c: Indent nested preprocessor conditionals

+    Reviewed-by: Iker Pedrosa ***@***.***>
     Signed-off-by: Alejandro Colomar ***@***.***>

  ## lib/utmp.c ##

2: ee54d49b ! 2: 91e43fee lib/utmp.c: Merge preprocessor conditionals @@ Metadata

Commit message

     lib/utmp.c: Merge preprocessor conditionals

+    Reviewed-by: Iker Pedrosa ***@***.***>
     Signed-off-by: Alejandro Colomar ***@***.***>

  ## lib/utmp.c ##

3: 1bc3b340 ! 3: 3947d9c6 lib/utmp.c: Remove #endif comments @@ Commit message

     Indentation makes it clear which is which.

+    Reviewed-by: Iker Pedrosa ***@***.***>
     Signed-off-by: Alejandro Colomar ***@***.***>

  ## lib/utmp.c ##

4: 7c7223df ! 4: 08dff703 lib/utmp.c: Use defined() instead of #if[n]def @@ Metadata

Commit message

     lib/utmp.c: Use defined() instead of #if[n]def

+    Reviewed-by: Iker Pedrosa ***@***.***>
     Signed-off-by: Alejandro Colomar ***@***.***>

  ## lib/utmp.c ##

5: 52b4deef ! 5: 5a936adc lib/utmp.c: Use the appropriate autotools macros for struct utmpx @@ Commit message Link: https://github.com/shadow-maint/shadow/pull/954 Cc: Firas Khalil Khana @.***> Cc: "A. Wilfox" https://github.com/awilfox

-- Reply to this email directly or view it on GitHub: https://github.com/shadow-maint/shadow/pull/955#pullrequestreview-1892293554 You are receiving this because you authored the thread.

Message ID: @.***>

-- https://www.alejandro-colomar.es/

alejandro-colomar commented 5 months ago

I'm not able to reproduce the problem from the CI, so I'll open a PR to be able to see those errors in the CI.

alejandro-colomar commented 5 months ago

I've put the commit in this PR, so that we can test it with this failure.

v3 changes:

(I'll probably want to do something similar with the cmocka logs.)

$ git range-diff shadow/master gh/utmpx utmpx 
1:  bceeefe2 = 1:  bceeefe2 lib/utmp.c: Indent nested preprocessor conditionals
2:  91e43fee = 2:  91e43fee lib/utmp.c: Merge preprocessor conditionals
3:  3947d9c6 = 3:  3947d9c6 lib/utmp.c: Remove #endif comments
4:  08dff703 = 4:  08dff703 lib/utmp.c: Use defined() instead of #if[n]def
5:  5a936adc = 5:  5a936adc lib/utmp.c: Use the appropriate autotools macros for struct utmpx
-:  -------- > 6:  f232202e .github/workflows/runner.yml: Use trap(1) to show the testsuite log
alejandro-colomar commented 5 months ago

Huh, a Heisenbug. When we try to measure it, it disappears. :|

I'll drop the last patch, and trigger a new run of CI, and see it it reproduces again.

alejandro-colomar commented 5 months ago

v3.1:

$ git range-diff shadow/master gh/utmpx utmpx 
1:  bceeefe2 = 1:  bceeefe2 lib/utmp.c: Indent nested preprocessor conditionals
2:  91e43fee = 2:  91e43fee lib/utmp.c: Merge preprocessor conditionals
3:  3947d9c6 = 3:  3947d9c6 lib/utmp.c: Remove #endif comments
4:  08dff703 = 4:  08dff703 lib/utmp.c: Use defined() instead of #if[n]def
5:  5a936adc = 5:  f29895f0 lib/utmp.c: Use the appropriate autotools macros for struct utmpx
6:  f232202e < -:  -------- .github/workflows/runner.yml: Use trap(1) to show the testsuite log
alejandro-colomar commented 5 months ago

v3.3:

alejandro-colomar commented 5 months ago

Since tests pass now, and we're again in v2c, as reviewed by Iker, I'll merge.