Skip to content

Commit

Permalink
Check hasattr before setting fcntl.F_SETPIPE_SZ
Browse files Browse the repository at this point in the history
  • Loading branch information
gdzx committed Jul 5, 2022
1 parent aadf7b0 commit 3948075
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion audiosource
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ import os
import socket
import sys
if not hasattr(fcntl, 'F_SETPIPE_SZ'):
fcntl.F_SETPIPE_SZ = 1031
PIPE_SIZE = 4096
BUF_SIZE = 1024 # Must be less than PIPE_BUF = 4096 for atomic writes.
fcntl.F_SETPIPE_SZ = 1031
def socat(inp, out):
buf = bytearray(BUF_SIZE)
Expand Down

0 comments on commit 3948075

Please sign in to comment.