From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 1C90646BB5 for ; Tue, 4 Jul 2023 20:08:48 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 33C0668C628; Tue, 4 Jul 2023 23:08:47 +0300 (EEST) Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F075E68C51D for ; Tue, 4 Jul 2023 23:08:40 +0300 (EEST) Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-6b73a2d622dso22539a34.0 for ; Tue, 04 Jul 2023 13:08:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688501319; x=1691093319; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=8soiFgotsLTIJo1ix6YlniozH4Q4US2YqgsUt6oeuCQ=; b=DsqggRc/1EH/3iqSEy4w2RHAoGSkJ8hTZKc2VwTQUN9Z8h2dsXai85XIPcoJ+oy00l 2LcyOi5MlBtm/JO9PD++mD2dwhfYTUIPno/9DFeyskGpQ1NLbuvDjb1lNQCIHSVsLuo+ V05y4SS9ZIOoY7ePfyF3UCHSlWEZkxBme4M2/hRecSun3CoWoQv5kj8LnvoORB5G3nLH L3bx5bYB3uJOlaOyJStfX1f6A13R0O3VA1UJGLKEaE8SxmifKJdwPBGdVbHrYjLToy0T ItqKIr59K5r5+OJ4rIwZU32P7enT4ujXofxbbela+c2EF+VTnfDl0GkclIduGCQem5xU mZfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688501319; x=1691093319; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8soiFgotsLTIJo1ix6YlniozH4Q4US2YqgsUt6oeuCQ=; b=V/6/qdyv7KmV93Ghpj3kK1zBlFOE7kaEFcydwzyljhnncKBwhPK6YrWbMFo9/8h38Y Vv9oveCJnxJI2J2cTaJIU7OvH/IKaZ8rHnm7MQjMUbR3oJ9Any+jgsWYdztaAjv1I+iU AZT2nmBKREOEv1ieVXbt+t5Z5Ts9MR0lpU4wxftENwPd5PhRmq33XN9tRrT/OWG9r6bX Y1nTsjaktv2Iq/AcySqWbx834QTT6ApYnefnEsRQKtV56BEgTYn4o3JdJdpl3QIelh+/ v3DHrlbOlM7Y/FyeYmoUXTqW4GEmoMOPHQILmihAuY+Zz/aYhkLLJbnXBQB+CZPnRiob JMDA== X-Gm-Message-State: ABy/qLawo5P8ipbii+xT+urzlqAy3pL3ntaOM9FKPca0oo4ksgNiqMah OdlccS8gi+qIXtjvgNQQ3NhokNryC+g= X-Google-Smtp-Source: APBJJlH18OICXhrqdutq9ZBl8PWmJ6Gxld6c/twod17NXIPvWW4NLsR4vJKcUki/V1VBUq18qMwDCg== X-Received: by 2002:a05:6830:3092:b0:6b7:4674:2383 with SMTP id g18-20020a056830309200b006b746742383mr94071ots.18.1688501319476; Tue, 04 Jul 2023 13:08:39 -0700 (PDT) Received: from [192.168.0.12] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id c12-20020a9d480c000000b006b71a4567absm5681483otf.58.2023.07.04.13.08.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Jul 2023 13:08:39 -0700 (PDT) Message-ID: <015b4860-af67-5d23-2cd2-eac877d38df7@gmail.com> Date: Tue, 4 Jul 2023 17:08:40 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20230704185044.2154-1-jamrial@gmail.com> <5a79a98-acb9-62bc-5279-e3624fc3c5@passwd.hu> <78fb24a6-831e-e38e-1064-a9e316d8fea6@gmail.com> <168850077133.542.4969284195602855710@lain.khirnov.net> From: James Almer In-Reply-To: <168850077133.542.4969284195602855710@lain.khirnov.net> Subject: Re: [FFmpeg-devel] [PATCH 1/2] avutil/random_seed: add av_random() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 7/4/2023 4:59 PM, Anton Khirnov wrote: >> >> Not if any of the functions above were called but failed to fill the buffer. >> >> I could add return AVERROR(ENOSYS) to the HAVE_UNISTD_H block, and >> return AVERROR_INVALIDDATA outside. > > AVERROR_INVALIDDATA is defined as 'Invalid data found when processing > input'. > This function does not process any input, so IMO that code never makes > sense for it. > > I'd say make it ENOSYS, AVERROR_UNKNOWN, or keep around one of > individual method errors. For the cases read() is used for /dev/random/, i can return AVERROR(errno), given the doxy states read() returns -1 on error and sets errno to some value. Although if it succeeds and returns a value smaller than len i would need to return AVERROR_UNKNOWN like you suggested. RAND_bytes from OpenSSL returns 0 or -1 on error, so nothing i can propagate. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".