[riot-commits] [RIOT-OS/RIOT] 2936a6: posix: sockets: Fix return value of listen functio...

Martine Lenders authmillenon at gmail.com
Sat Mar 11 19:22:36 CET 2017


  Branch: refs/heads/master
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: 2936a69a1b3ad4f6dffbff652eb1b6ca7756754d
      https://github.com/RIOT-OS/RIOT/commit/2936a69a1b3ad4f6dffbff652eb1b6ca7756754d
  Author: Francois Berder <francois.berder at imgtec.com>
  Date:   2017-03-06 (Mon, 06 Mar 2017)

  Changed paths:
    M sys/posix/sockets/posix_sockets.c

  Log Message:
  -----------
  posix: sockets: Fix return value of listen function

If an error happens, listen was returning 1 instead of -1.

Signed-off-by: Francois Berder <francois.berder at imgtec.com>


  Commit: 8f839fbc317aebd9cc893a62d981858d354e7ded
      https://github.com/RIOT-OS/RIOT/commit/8f839fbc317aebd9cc893a62d981858d354e7ded
  Author: Francois Berder <francois.berder at imgtec.com>
  Date:   2017-03-07 (Tue, 07 Mar 2017)

  Changed paths:
    M sys/posix/sockets/posix_sockets.c

  Log Message:
  -----------
  posix: sockets: address was not set in recvfrom

The address is an optional parameter of recvfrom. If it is
not null, recvfrom must store the address of the sender.
However this was only allowed if res was equal to 0, which
is wrong since res contains the number of bytes received
or -1.
This commit ensures that the address is set only if no
previous errors happened before.

Signed-off-by: Francois Berder <francois.berder at imgtec.com>


  Commit: 8d2ec19be6421e5b6164a5e034891c367c66c1b0
      https://github.com/RIOT-OS/RIOT/commit/8d2ec19be6421e5b6164a5e034891c367c66c1b0
  Author: Francois Berder <francois.berder at imgtec.com>
  Date:   2017-03-07 (Tue, 07 Mar 2017)

  Changed paths:
    M sys/posix/sockets/posix_sockets.c

  Log Message:
  -----------
  posix: sockets: Fix timeout regression of recvfrom

Commit de41971aab3b9da84ee3d5db8406ecdf4b0e21b4 sets the default
timeout to 0. This change should not have been part of the commit.

Signed-off-by: Francois Berder <francois.berder at imgtec.com>


  Commit: 27dec749e8c7909922148a26dd27ca7a2adcb074
      https://github.com/RIOT-OS/RIOT/commit/27dec749e8c7909922148a26dd27ca7a2adcb074
  Author: Francois Berder <francois.berder at imgtec.com>
  Date:   2017-03-07 (Tue, 07 Mar 2017)

  Changed paths:
    M sys/posix/sockets/posix_sockets.c

  Log Message:
  -----------
  posix: sockets: Fix return value of recvfrom and sendto

_bind_connect already sets errno and returns -1 or 0.

Signed-off-by: Francois Berder <francois.berder at imgtec.com>


  Commit: 4a51d1b433a4a9e04e43771f39bd7780d7266c52
      https://github.com/RIOT-OS/RIOT/commit/4a51d1b433a4a9e04e43771f39bd7780d7266c52
  Author: Martine Lenders <authmillenon at gmail.com>
  Date:   2017-03-11 (Sat, 11 Mar 2017)

  Changed paths:
    M sys/posix/sockets/posix_sockets.c

  Log Message:
  -----------
  Merge pull request #6697 from francois-berder-imgtec/awalwm2m

posix: sockets: Small fixes for listen and recvfrom functions


Compare: https://github.com/RIOT-OS/RIOT/compare/ee4b2ce3312b...4a51d1b433a4


More information about the commits mailing list