journal-send: Fix the limitation of LINE_MAX
authorAnkit Jain <ankitja@vmware.com>
Fri, 6 Mar 2020 12:57:50 +0000 (18:27 +0530)
committerAnkit Jain <ankitja@vmware.com>
Thu, 14 May 2020 17:15:34 +0000 (17:15 +0000)
commit2eaf435a16f4ec9ba15509ef9d31eca7b4f7ace7
treee1c5cf33d34e01d8b3b2025b399ddb9820ad326f
parent969d32949052c1b5861a942abc4f1a065a91074d
journal-send: Fix the limitation of LINE_MAX

- If length of formatted string >= LONG_LINE_MAX then return -ENOBUFS
- Normal Case:
  - length of formatted string < POSIX defined LINE_MAX
  - Allocate sbuf to accomodate the message
- Rare case:
  - LINE_MAX < length of formatted string < LONG_LINE_MAX
  - Allocate the required length using alloca()
src/journal/journal-send.c